void IntlUtil::getDefaultCollationAttributes(UCharBuffer& collAttributes, charset& cs) { string attributes("ICU-VERSION="); attributes += Jrd::UnicodeUtil::getDefaultIcuVersion(); setupIcuAttributes(&cs, attributes, "", attributes); collAttributes.push(reinterpret_cast<const UCHAR*>(attributes.c_str()), attributes.length()); }
UnicodeCollationHolder::UnicodeCollationHolder(MemoryPool& pool) { cs = FB_NEW(pool) charset; tt = FB_NEW(pool) texttype; IntlUtil::initUtf8Charset(cs); string collAttributes("ICU-VERSION="); collAttributes += Jrd::UnicodeUtil::DEFAULT_ICU_VERSION; IntlUtil::setupIcuAttributes(cs, collAttributes, "", collAttributes); UCharBuffer collAttributesBuffer; collAttributesBuffer.push(reinterpret_cast<const UCHAR*>(collAttributes.c_str()), collAttributes.length()); if (!IntlUtil::initUnicodeCollation(tt, cs, "UNICODE", 0, collAttributesBuffer, string())) fatal_exception::raiseFmt("cannot initialize UNICODE collation to use in trace plugin"); charSet = Jrd::CharSet::createInstance(pool, 0, cs); textType = FB_NEW(pool) Jrd::TextType(0, tt, charSet); }