samedi 27 octobre 2018

How to convert from "universal character name" to a sequence of wchar_t's?

In my application I need to be able to parse string literals supported by C++14 standard. So I'm reading this article on the subject and I'm trying to understand, how do I convert from a universal character name to a sequence of wchar_ts?

Let me explain with this example. Say, if I compile the following with VS 2017:

const wchar_t* str2 = L"\U0001F609 is ;-)";

str2 becomes the following sequence of bytes in memory:

enter image description here

So how did \U0001F609 become 3d d8 09 de? Or, what WinAPI do I need to make this conversion?

Aucun commentaire:

Enregistrer un commentaire