Boost logo

Boost :

Subject: Re: [boost] [review] Review of Nowide (Unicode) starts today
From: Artyom Beilis (artyom.beilis_at_[hidden])
Date: 2017-06-12 10:52:50


>
> 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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk