Created
October 20, 2011 20:40
-
-
Save roktas/1302318 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 <stdio.h> | |
#include <locale.h> | |
#include <wchar.h> | |
/* | |
* Hem Linux, hem de Windows konsolda Türkçe karakterleri hatasız görüntüleyen | |
* bir kod. | |
* | |
* Alakasız ipucu: Windows 7'de Visual Studio Express 2010 sürümünde program | |
* çalıştıktan sonra konsolun kaybolmaması için: | |
* | |
* Proje → Properties (sağ tıkla) → Linker → System sekmesinde | |
* Subsystem → "Console (/SUBSYTEM:CONSOLE)" eklemesini yap | |
*/ | |
int | |
main(void) | |
{ | |
/* | |
* Yereli daima etkinleştir | |
*/ | |
setlocale(LC_ALL, ""); | |
/* | |
* Standart çıktıyı geniş karakterler için ayarla | |
*/ | |
if (fwide(stdout, 1) <= 0) { | |
fprintf(stderr, "stdout genis karakterlere ayarlanamadi\n"); | |
return 1; | |
} | |
/* | |
* Bu noktadan sonra w* işlevlerini kullan, dizgi sabitlerini L ile yaz | |
*/ | |
wprintf(L"ığüşöçİĞÜŞÖÇ\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment