Thread Surrogate Pairs in UTF-8 auflösen (28 answers)
Opened by barney at 2025-08-14 14:22

rosti
 2025-08-15 13:21
#197210 #197210
User since
2011-03-19
3688 Artikel
BenutzerIn
[Homepage]
user image
Über die Qualität dieses Artikel lässt sich streiten ;)

Also, mit Javascript sieht das so aus:

Code: (dl )
1
2
3
4
5
6
7
8
    out = [0xD83D, 0xDE00];
var chars = '';
for(i = 0; i < out.length; i++){
chars += String.fromCodePoint( out[i] );
let b = new Blob([chars]);
console.log(i, out[i], chars.length, b.size)
}
console.log(chars);



console:

Code: (dl )
1
2
0 55357 1 3 
1 56832 2 4


Aber ich denke, diese 4 Bytes sind UTF-8
Last edited: 2025-08-15 13:24:11 +0200 (CEST)
http://blog.rolfrost.de/

The art of steam.

View full thread Surrogate Pairs in UTF-8 auflösen