| 92 | /////////////////////////////////////////// |
| 93 | |
| 94 | int32_t utf8_encode_units(char32_t ch) { |
| 95 | if (ch <= 0x7F) return 1; |
| 96 | else if (ch <= 0x07FF) return 2; |
| 97 | else if (ch <= 0xFFFF) return 3; |
| 98 | else if (ch <= 0x10FFFF) return 4; |
| 99 | else return 0; |
| 100 | } |
| 101 | |
| 102 | /////////////////////////////////////////// |
| 103 |
no outgoing calls
no test coverage detected