Created
November 14, 2012 02:00
-
-
Save MihailJP/4069788 to your computer and use it in GitHub Desktop.
Using wchar_t working with locale
This file contains 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> | |
#include <stdlib.h> | |
#include <locale.h> | |
int main() { | |
char* syslocale = getenv("LANG"); | |
const wchar_t teststr[] = | |
L"僕と契約して、" | |
L"プログラマになってよ!"; | |
setlocale(LC_ALL, syslocale); | |
wprintf(L"%s\n", teststr); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment