Skip to content

Instantly share code, notes, and snippets.

@MihailJP
Created November 14, 2012 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MihailJP/4069788 to your computer and use it in GitHub Desktop.
Save MihailJP/4069788 to your computer and use it in GitHub Desktop.
Using wchar_t working with locale
#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