12 Jun
2017
12 Jun
'17
10:52 a.m.
On a related note, does it support WTF-8? I.e. encoding lone UTF-16 surrogates (malformed UTF-16 sequences) within the UTF-8 scheme. It is needed to guarantee UTF-16 → UTF-8 → UTF-16 roundtrip of invalid UTF-16 data on Windows, and is not an invalid behavior per se, because all valid UTF-16 sequences still map bijectively onto valid UTF-8 sequences.
-- Yakov Galka http://stannum.co.il/
No it does not. I considered it before but I think that security risk of creating or accepting malformed UTF-8 or UTF-16. Converting invalid UTF-16 to WTF-8 and other way around is not obvious behavior and has potential of security risk especially for users that are not aware of such an issue. So invalid UTF-8/16 sequences are rejected by design. Artyom