5

I noticed on cppreference.com that this and related things in the <codecvt> header are deprecated in C++17.

So what's the alternative that is supported?

I'm trying to convert an int into a std::u32srting in order to properly support unicode. I was going to convert with std::to_string or std::to_wstring before using std::wstring_convert but noticed it's deprecated. I would much rather use the correct most recent standard.

baduker
  • 19,152
  • 9
  • 33
  • 56
NeomerArcana
  • 1,978
  • 3
  • 23
  • 50
  • 2
    Perhaps you [*shouldn't*](http://utf8everywhere.org/) convert to UTF-32? – Some programmer dude Apr 01 '18 at 10:25
  • Okay... but don't I have the same problem converting to UTF-8 @Someprogrammerdude – NeomerArcana Apr 01 '18 at 10:26
  • That's the nice thing about UTF-8, it's a *byte* encoding. Which means you can basically use `char` and `std::string` without any problems. :) – Some programmer dude Apr 01 '18 at 10:28
  • @NeomerArcana: "*I'm trying to convert an int into a std::u32srting*" What do you mean by that exactly? Are you trying to do integer-to-string conversion (the integer 23 becomes the string "23"), or are you trying to interpret the `int` as a Unicode codepoint (the integer 2450 becomes the codepoint U+0992). – Nicol Bolas Apr 01 '18 at 14:20
  • @NicolBolas trying to make the string "23" – NeomerArcana Apr 01 '18 at 23:20

0 Answers0