[SG16-Unicode] Do we really need basic_text_view?

Tom Honermann tom at honermann.net
Sun Aug 5 21:43:16 CEST 2018


Adding the SG16 list back in...

> On 08/04/2018 10:33 PM, Lyberta wrote:
> Tom Honermann:
>> I agree we need those transcoding functions.
> Since it is impossible to implement std::filesystem without them, they
> are already implemented in at least libstdc++, haven't checked other
> implementations yet.

The std::filesystem conversions don't necessarily convert as you might expect.  For example, libstdc++ always assumes UTF-8 (not necessarily well-formed) for its 'char' based interfaces and performs no conversions for the `char` and u8path cases. Specifically, the following does not actually perform a conversion from the execution character encoding to UTF-8.

std::filesystem::path p = "text";
p.u8string();

> 
>> An outstanding question
>> is, do we provide them as additional codecvt specializations
> I think codecvt was exceptionally badly designed. I think we need to
> split fundamental bits from text_view proposal into a separate proposal
> and then work on top of them.

Adding transcoding interfaces to text_view is yet another thing that has been on my todo list for a long time (https://github.com/tahonermann/text_view/issues/4).

Tom.



More information about the Unicode mailing list