r/cpp • u/User_Deprecated • Sep 30 '26
Transcoding UTF-8 to UTF-16 with replacement at gigabytes per second
https://lemire.me/blog/2026/09/30/transcoding-utf-8-to-utf-16-with-replacement-at-gigabytes-per-second/
74
Upvotes
6
u/Expert_Sheepherder24 Oct 02 '26
Can be replace to
auto utf16 = std::make_unique_for_overwrite<char16_t[]>(res.count);seems.
28
u/scalablecory Oct 01 '26
I tried SIMD UTF8 decoding maybe 15 years ago and couldn’t crack it efficiently. Cool to see the advancements made in the last while