| 645 | |
| 646 | |
| 647 | void _hx_utf8_iter(String inString, Dynamic inIter) |
| 648 | { |
| 649 | #ifdef HX_SMART_STRINGS |
| 650 | if (inString.isUTF16Encoded()) |
| 651 | for(int i=0;i<inString.length;i++) |
| 652 | inIter( (int)inString.raw_wptr()[i] ); |
| 653 | else |
| 654 | for(int i=0;i<inString.length;i++) |
| 655 | inIter( (int)inString.raw_ptr()[i] ); |
| 656 | #else |
| 657 | const unsigned char *src = (const unsigned char *)inString.__s; |
| 658 | const unsigned char *end = src + inString.length; |
| 659 | |
| 660 | while(src<end) |
| 661 | inIter(DecodeAdvanceUTF8(src,end+1)); |
| 662 | |
| 663 | if (src>end) |
| 664 | hx::Throw(HX_CSTRING("Invalid UTF8")); |
| 665 | #endif |
| 666 | } |
| 667 | |
| 668 | int _hx_utf8_char_code_at(String inString, int inIndex) |
| 669 | { |
nothing calls this directly
no test coverage detected