IntlUtil.cpp (Firebird-3.0.2.32703-0.tar.bz2) | : | IntlUtil.cpp (Firebird-3.0.4.33054-0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 50 | skipping to change at line 50 | |||
struct TextTypeImpl | struct TextTypeImpl | |||
{ | { | |||
TextTypeImpl(charset* a_cs, UnicodeUtil::Utf16Collation* a_collat ion) | TextTypeImpl(charset* a_cs, UnicodeUtil::Utf16Collation* a_collat ion) | |||
: cs(a_cs), | : cs(a_cs), | |||
collation(a_collation) | collation(a_collation) | |||
{ | { | |||
} | } | |||
~TextTypeImpl() | ~TextTypeImpl() | |||
{ | { | |||
if (cs->charset_fn_destroy) | Firebird::IntlUtil::finiCharset(cs); | |||
cs->charset_fn_destroy(cs); | ||||
delete cs; | delete cs; | |||
delete collation; | delete collation; | |||
} | } | |||
charset* cs; | charset* cs; | |||
UnicodeUtil::Utf16Collation* collation; | UnicodeUtil::Utf16Collation* collation; | |||
}; | }; | |||
} | } | |||
skipping to change at line 521 | skipping to change at line 520 | |||
{ | { | |||
gds__log("initUnicodeCollation failed - UnicodeUtil::Utf16Collati on::create failed"); | gds__log("initUnicodeCollation failed - UnicodeUtil::Utf16Collati on::create failed"); | |||
return false; | return false; | |||
} | } | |||
tt->texttype_impl = FB_NEW TextTypeImpl(cs, collation); | tt->texttype_impl = FB_NEW TextTypeImpl(cs, collation); | |||
return true; | return true; | |||
} | } | |||
void IntlUtil::finiCharset(charset* cs) | ||||
{ | ||||
if (cs->charset_to_unicode.csconvert_fn_destroy) | ||||
cs->charset_to_unicode.csconvert_fn_destroy(&cs->charset_to_unico | ||||
de); | ||||
if (cs->charset_from_unicode.csconvert_fn_destroy) | ||||
cs->charset_from_unicode.csconvert_fn_destroy(&cs->charset_from_u | ||||
nicode); | ||||
if (cs->charset_fn_destroy) | ||||
cs->charset_fn_destroy(cs); | ||||
} | ||||
ULONG IntlUtil::toLower(Jrd::CharSet* cs, ULONG srcLen, const UCHAR* src, ULONG dstLen, UCHAR* dst, | ULONG IntlUtil::toLower(Jrd::CharSet* cs, ULONG srcLen, const UCHAR* src, ULONG dstLen, UCHAR* dst, | |||
const ULONG* exceptions) | const ULONG* exceptions) | |||
{ | { | |||
const ULONG utf16_length = cs->getConvToUnicode().convertLength(srcLen); | const ULONG utf16_length = cs->getConvToUnicode().convertLength(srcLen); | |||
Firebird::HalfStaticArray<UCHAR, BUFFER_SMALL> utf16_str; | Firebird::HalfStaticArray<UCHAR, BUFFER_SMALL> utf16_str; | |||
UCHAR* utf16_ptr; | UCHAR* utf16_ptr; | |||
if (dstLen >= utf16_length) // if dst buffer is sufficient large, use it as intermediate | if (dstLen >= utf16_length) // if dst buffer is sufficient large, use it as intermediate | |||
utf16_ptr = dst; | utf16_ptr = dst; | |||
else | else | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 13 lines changed or added |