| 621 | |
| 622 | |
| 623 | ULONG IntlUtil::toUpper(Jrd::CharSet* cs, ULONG srcLen, const UCHAR* src, ULONG dstLen, UCHAR* dst, |
| 624 | const ULONG* exceptions) |
| 625 | { |
| 626 | const ULONG utf16_length = cs->getConvToUnicode().convertLength(srcLen); |
| 627 | Firebird::HalfStaticArray<UCHAR, BUFFER_SMALL> utf16_str; |
| 628 | UCHAR* utf16_ptr; |
| 629 | |
| 630 | if (dst != src && dstLen >= utf16_length) // if dst buffer is sufficient large, use it as intermediate |
| 631 | utf16_ptr = dst; |
| 632 | else |
| 633 | utf16_ptr = utf16_str.getBuffer(utf16_length); |
| 634 | |
| 635 | // convert to UTF-16 |
| 636 | srcLen = cs->getConvToUnicode().convert(srcLen, src, utf16_length, utf16_ptr); |
| 637 | |
| 638 | // convert to uppercase |
| 639 | Firebird::HalfStaticArray<UCHAR, BUFFER_SMALL> upper_str; |
| 640 | srcLen = UnicodeUtil::utf16UpperCase(srcLen, Firebird::Aligner<USHORT>(utf16_ptr, srcLen), |
| 641 | utf16_length, Firebird::OutAligner<USHORT>(upper_str.getBuffer(utf16_length), utf16_length), |
| 642 | exceptions); |
| 643 | |
| 644 | // convert to original character set |
| 645 | return cs->getConvFromUnicode().convert(srcLen, upper_str.begin(), dstLen, dst); |
| 646 | } |
| 647 | |
| 648 | |
| 649 | bool IntlUtil::readOneChar(Jrd::CharSet* cs, const UCHAR** s, const UCHAR* end, ULONG* size) |
nothing calls this directly
no test coverage detected