| 1413 | } |
| 1414 | |
| 1415 | UnicodeUtil::Utf16Collation* UnicodeUtil::Utf16Collation::create( |
| 1416 | texttype* tt, USHORT attributes, |
| 1417 | Firebird::IntlUtil::SpecificAttributesMap& specificAttributes, const Firebird::string& configInfo) |
| 1418 | { |
| 1419 | int attributeCount = 0; |
| 1420 | bool error; |
| 1421 | |
| 1422 | string locale; |
| 1423 | if (specificAttributes.get(IntlUtil::convertAsciiToUtf16("LOCALE"), locale)) |
| 1424 | ++attributeCount; |
| 1425 | |
| 1426 | string collVersion; |
| 1427 | if (specificAttributes.get(IntlUtil::convertAsciiToUtf16("COLL-VERSION"), collVersion)) |
| 1428 | { |
| 1429 | ++attributeCount; |
| 1430 | |
| 1431 | collVersion = IntlUtil::convertUtf16ToAscii(collVersion, &error); |
| 1432 | if (error) |
| 1433 | { |
| 1434 | gds__log("IntlUtil::convertUtf16ToAscii failed"); |
| 1435 | return NULL; |
| 1436 | } |
| 1437 | } |
| 1438 | |
| 1439 | string numericSort; |
| 1440 | if (specificAttributes.get(IntlUtil::convertAsciiToUtf16("NUMERIC-SORT"), numericSort)) |
| 1441 | { |
| 1442 | ++attributeCount; |
| 1443 | |
| 1444 | numericSort = IntlUtil::convertUtf16ToAscii(numericSort, &error); |
| 1445 | if (error || !(numericSort == "0" || numericSort == "1")) |
| 1446 | { |
| 1447 | gds__log("IntlUtil::convertUtf16ToAscii failed"); |
| 1448 | return NULL; |
| 1449 | } |
| 1450 | } |
| 1451 | |
| 1452 | string disableCompressions; |
| 1453 | if (specificAttributes.get(IntlUtil::convertAsciiToUtf16("DISABLE-COMPRESSIONS"), disableCompressions)) |
| 1454 | { |
| 1455 | ++attributeCount; |
| 1456 | |
| 1457 | disableCompressions = IntlUtil::convertUtf16ToAscii(disableCompressions, &error); |
| 1458 | if (error || !(disableCompressions == "0" || disableCompressions == "1")) |
| 1459 | { |
| 1460 | gds__log("IntlUtil::convertUtf16ToAscii failed"); |
| 1461 | return NULL; |
| 1462 | } |
| 1463 | } |
| 1464 | |
| 1465 | locale = IntlUtil::convertUtf16ToAscii(locale, &error); |
| 1466 | if (error) |
| 1467 | { |
| 1468 | gds__log("IntlUtil::convertUtf16ToAscii failed"); |
| 1469 | return NULL; |
| 1470 | } |
| 1471 | |
| 1472 | if ((attributes & ~(TEXTTYPE_ATTR_PAD_SPACE | TEXTTYPE_ATTR_CASE_INSENSITIVE | |
nothing calls this directly
no test coverage detected