-----------------------------------------------------------------------------
| 479 | |
| 480 | //----------------------------------------------------------------------------- |
| 481 | const UTF16 oneUTF32toUTF16(const UTF32 codepoint) |
| 482 | { |
| 483 | // found a codepoint outside the codeable UTF-16 range! |
| 484 | // or, found an illegal codepoint! |
| 485 | if(codepoint >= 0x10FFFF || isSurrogateRange(codepoint)) |
| 486 | return kReplacementChar; |
| 487 | |
| 488 | // these are legal, we just dont want to deal with them. |
| 489 | if(isAboveBMP(codepoint)) |
| 490 | return kReplacementChar; |
| 491 | |
| 492 | return (UTF16)codepoint; |
| 493 | } |
| 494 | |
| 495 | //----------------------------------------------------------------------------- |
| 496 | const U32 oneUTF32toUTF8(const UTF32 codepoint, UTF8 *threeByteCodeunitBuf) |
no test coverage detected