Just because I saw a video about it in my youtube algorithm and i didn’t have the exact idea of how it works. 😂
| Feature | UTF-8 | UTF-16 |
|---|---|---|
| Byte size | 1–4 bytes | 2 or 4 bytes |
| Endianness | No | Yes (UTF-16LE or UTF-16BE) |
| ASCII efficient | ✅ | ❌ (always 2 bytes) |
| Non-Latin efficient | ❌ | ✅ |
| Web default | ✅ | ❌ |
| Character | Unicode | UTF-8 bytes | UTF-16 bytes |
|---|---|---|---|
| A | U+0041 | 41 |
00 41 |
| é | U+00E9 | C3 A9 |
00 E9 |
| 😀 | U+1F600 | F0 9F 98 80 |
D8 3D DE 00 |