| 36 | } |
| 37 | |
| 38 | bool SplitUtf16HighChar(std::ostream& stream, EncodingFn encoding, int ch) { |
| 39 | int biasedValue = ch - 0x10000; |
| 40 | if (biasedValue < 0) { |
| 41 | return false; |
| 42 | } |
| 43 | int high = 0xD800 | (biasedValue >> 10); |
| 44 | int low = 0xDC00 | (biasedValue & 0x3FF); |
| 45 | encoding(stream, high); |
| 46 | encoding(stream, low); |
| 47 | return true; |
| 48 | } |
| 49 | |
| 50 | void EncodeToUtf16LE(std::ostream& stream, int ch) { |
| 51 | if (!SplitUtf16HighChar(stream, &EncodeToUtf16LE, ch)) { |
no outgoing calls
no test coverage detected