string to UTF-8 is trivial, you can do that yourself. 

UTF-8 to string where you just fail outright if the UTF-8 string contains any 
non-ASCII characters is also easy. 

However UTF-8 to ASCII where you want to identify and extract ascii characters 
from among Unicode ones gets much more complex as you need to start worrying 
about grapheme clusters. 

On 2 Sep 2025, at 17:34, Georg Gast via Boost-users 
<boost-users@lists.boost.org> wrote:

Hi,

as c++23 is now way out of the door and c++26 is already on the
horizon, is there any thing in the boost libraries cor the "new" u8
literal and the new u8strings?

I can only find mentioning char8_t in context of boost::filesystem.
https://www.boost.org/doc/libs/latest/libs/nowide/doc/html/index.html#using

   For std::filesystem::path available since C++17 there is no way
   to imbue a locale. However the u8string() member function can
   be used to obtain an UTF-8 encoded string from a path. And to
   obtain a path from an UTF-8 encoded string you may use
   std::filesystem::u8path or since C++20 one of the path
   constructors taking a char8_t-type input.

But it seems there is nothing like narrow() or widen() to convert from
std::u8string <-> std::string (needed for non char8_t aware libraries).
Think Win32 API.

Is the only recommendation: Just stay on std::string and ignore char8_t?
Still in 2025? Even with boost libraries?

Bye
 Georg
_______________________________________________
Boost-users mailing list -- boost-users@lists.boost.org
To unsubscribe send an email to boost-users-le...@lists.boost.org
https://lists.boost.org/mailman3/lists/boost-users.lists.boost.org/
Archived at: 
https://lists.boost.org/archives/list/boost-users@lists.boost.org/message/JYVSEA43TLRBQ24U6K6EEVDHVKVBOCR6/
_______________________________________________
Boost-users mailing list -- boost-users@lists.boost.org
To unsubscribe send an email to boost-users-le...@lists.boost.org
https://lists.boost.org/mailman3/lists/boost-users.lists.boost.org/
Archived at: 
https://lists.boost.org/archives/list/boost-users@lists.boost.org/message/H27OC5KAR4SLPH4GYGN2KA747E7EWTEH/
 

Reply via email to