| 2244 | } |
| 2245 | |
| 2246 | int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end) |
| 2247 | { |
| 2248 | int bytes_count = 0; |
| 2249 | while ((!in_text_end || in_text < in_text_end) && *in_text) |
| 2250 | { |
| 2251 | unsigned int c = (unsigned int)(*in_text++); |
| 2252 | if (c < 0x80) |
| 2253 | bytes_count++; |
| 2254 | else |
| 2255 | bytes_count += ImTextCountUtf8BytesFromChar(c); |
| 2256 | } |
| 2257 | return bytes_count; |
| 2258 | } |
| 2259 | IM_MSVC_RUNTIME_CHECKS_RESTORE |
| 2260 | |
| 2261 | //----------------------------------------------------------------------------- |
no test coverage detected