(ptr)
| 961 | |
| 962 | |
| 963 | function UTF32ToString(ptr) { |
| 964 | var i = 0; |
| 965 | |
| 966 | var str = ''; |
| 967 | while (1) { |
| 968 | var utf32 = HEAP32[(((ptr)+(i*4))>>2)]; |
| 969 | if (utf32 == 0) |
| 970 | return str; |
| 971 | ++i; |
| 972 | // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing. |
| 973 | // See http://unicode.org/faq/utf_bom.html#utf16-3 |
| 974 | if (utf32 >= 0x10000) { |
| 975 | var ch = utf32 - 0x10000; |
| 976 | str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF)); |
| 977 | } else { |
| 978 | str += String.fromCharCode(utf32); |
| 979 | } |
| 980 | } |
| 981 | } |
| 982 | |
| 983 | |
| 984 | // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr', |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…