apply utf32 buffer layout

This commit is contained in:
Jörg Breitbart
2019-01-03 19:01:43 +01:00
parent 27b91f6b00
commit ba1582cf3c
2 changed files with 83 additions and 29 deletions
-3
View File
@@ -76,9 +76,6 @@ export class StringToUtf32 {
* Polyfill - Convert UTF32 codepoint into JS string.
*/
export function stringFromCodePoint(codePoint: number): string {
if ((String as any).fromCodePoint) {
return (String as any).fromCodePoint(codePoint);
}
if (codePoint > 0xFFFF) {
codePoint -= 0x10000;
return String.fromCharCode((codePoint >> 10) + 0xD800) + String.fromCharCode((codePoint % 0x400) + 0xDC00);