C++ Logo

SG16

Advanced search

Subject: Re: [SG16-Unicode] Convert between std::u8string and std::string
From: Philipp Klaus Krause (krauseph_at_[hidden])
Date: 2019-05-06 15:55:57


Am 06.05.19 um 05:32 schrieb Tom Honermann:
>
> Philipp, do you perhaps know the history of how C came to have the UTF
> code-unit-at-a-time conversion functions (e.g., c16rtomb(), mbrtoc16()),
> but not the UTF string-at-a-time analogs of mbsrtowcs() and wcsrtombs()?
>

The earliest document I found is N1010
(http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1010.pdf), which
introduced the char16_t and char32_t types along with the conversion
functions.

It simply states "Speaking in general, it is desirable to free the C
applications from character-based operations and encourage string-based
operations. The detail of the library for the new character data types
should be left to the future enhancements of the C standard. This
technical report specifies merely the 4 minimum character conversions
among 3 character data types: char, char16_t and char32_t."

Philipp


SG16 list run by herb.sutter at gmail.com