Skip to content

Instantly share code, notes, and snippets.

@roktas
Created October 20, 2011 20:40
Show Gist options
  • Save roktas/1302318 to your computer and use it in GitHub Desktop.
Save roktas/1302318 to your computer and use it in GitHub Desktop.
#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