Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What replaces std::codecvt_utf8 in C++17 or how else do I convert an int to a u32 string? [duplicate]

A bit of foreground: my task required converting UTF-8 XML file to UTF-16 (with proper header, of course). And so I searched about usual ways of converting UTF-8 to UTF-16, and found out that one should use templates from <codecvt>.

But now when it is deprecated, I wonder what is the new common way of doing the same task?

(Don't mind using Boost at all, but other than that I prefer to stay as close to standard library as possible.)

like image 805
login_not_failed Avatar asked Nov 18 '22 16:11

login_not_failed


1 Answers

Don't worry about that.

According to the same information source:

this library component should be retired to Annex D, along side , until a suitable replacement is standardized.

So, you can still use it until a new standardized, more-secure version is done.

like image 136
xmllmx Avatar answered Dec 04 '22 22:12

xmllmx