From 70fbe7822024d0acc68df3607ff25bf8d7a71751 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 16 Jun 2005 23:19:27 +0000 Subject: initial import (automatically generated log message) --- example/example.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 example/example.c (limited to 'example/example.c') diff --git a/example/example.c b/example/example.c new file mode 100644 index 0000000..9666ae5 --- /dev/null +++ b/example/example.c @@ -0,0 +1,31 @@ +#include +#include +#include + +main() { + enum russian_charsets res; + char buf[255]; + int l; + + while (fgets(buf,255,stdin)) { + if (strlen(buf)<2) break; + + res = get_russian_charset(buf,0); + switch(res) { + case RUSSIAN_CHARSET_WIN: + printf("CP1251: "); + break; + case RUSSIAN_CHARSET_ALT: + printf("CP866 : "); + break; + case RUSSIAN_CHARSET_KOI: + printf("KOI8-R: "); + break; + case RUSSIAN_CHARSET_UTF8: + printf("UTF8 : "); + break; + } + printf("%s",buf); + if (buf[strlen(buf)-1]!='\n') printf("\n"); + } +} -- cgit v1.2.3