X-Git-Url: http://www.wagner.pp.ru/gitweb/?p=oss%2Fless.git;a=blobdiff_plain;f=charset.c;fp=charset.c;h=69b035f1d4a736f667470c43eef4dee57e2434e9;hp=4c62664e73d1008a48dc8bb564314c3c4c56f272;hb=0277876eac340b46a0201fc29b70ccb5e5f83f58;hpb=730780fea398916176ce07a4b7a54a45c6e6a1f0 diff --git a/charset.c b/charset.c index 4c62664..69b035f 100644 --- a/charset.c +++ b/charset.c @@ -14,6 +14,9 @@ */ #include "less.h" +#if MSDOS_COMPILER==WIN32C +#include +#endif #if HAVE_LOCALE #include #include @@ -319,7 +322,15 @@ set_charset() ichardef(s); return; } - +#ifdef WIN32 + SetConsoleOutputCP(65001); + _setmode(_fileno(stdout),_O_U8TEXT); + _setmode(_fileno(stderr),_O_U8TEXT); + if (isatty(fileno(stdin))) + _setmode(_fileno(stdin),_O_U8TEXT); + icharset("UTF-8",0); + +#else #if HAVE_LOCALE #ifdef CODESET /* @@ -364,6 +375,7 @@ set_charset() (void) icharset("latin1", 1); #endif #endif +#endif } /*