Last active
June 9, 2016 05:19
-
-
Save milesrout/0094dd076ada26b88d7e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <wchar.h> | |
int main() | |
{ | |
mbstate_t mbstate; | |
wchar_t const wcs[] = "\U00000055\U0000006E\U00000069\U00000063\U0000006F\U00000064\U00000065"; | |
wchar_t const* wcsptr = wcs; | |
char mbs[256]; | |
memset(&mbstate, 0, sizeof mbstate); | |
wcsrtombs(mbs, &wcsptr, sizeof(wcs) / sizeof(wcs[0]), &mbstate); | |
printf("%s\n", mbs); | |
wprintf("%s\n", wcs); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment