Lemire ports V8's fast UTF-16 string-fixing algorithm to C# in SimdUnicode

lemire · x · 2026-09-27

Daniel Lemire explains how to quickly fix ill-formed UTF-16 strings in C#, where lone surrogates (common with emoji) make strings unsafe to persist or transmit. His PR #54 in SimdUnicode adds ToWellFormed/IsWellFormed using the same algorithm contributed to V8, so Chrome already fixes strings this way.

Original post →

More from Research

Research channel →