| 692 | } |
| 693 | |
| 694 | int _hx_utf8_length(String inString) |
| 695 | { |
| 696 | #ifdef HX_SMART_STRINGS |
| 697 | return inString.length; |
| 698 | #else |
| 699 | |
| 700 | const unsigned char *src = (const unsigned char *)inString.__s; |
| 701 | const unsigned char *end = src + inString.length; |
| 702 | |
| 703 | int len = 0; |
| 704 | const unsigned char *sLen = getUtf8LenArray(); |
| 705 | while(src<end) |
| 706 | { |
| 707 | src += sLen[*src]; |
| 708 | len++; |
| 709 | } |
| 710 | if (src>end) |
| 711 | hx::Throw(HX_CSTRING("Invalid UTF8")); |
| 712 | return len; |
| 713 | #endif |
| 714 | } |
| 715 | |
| 716 | bool _hx_utf8_is_valid(String inString) |
| 717 | { |
nothing calls this directly
no test coverage detected