From 6a2d2e5ef8cc0938009bf8c21e06a13afb4338f2 Mon Sep 17 00:00:00 2001 From: Stas Degteff Date: Sun, 4 Feb 2007 08:31:32 +0000 Subject: [PATCH] Use LANG enviroment variable to select DOS-charset in unixes --- goldlib/gall/gcharset.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/goldlib/gall/gcharset.cpp b/goldlib/gall/gcharset.cpp index c66746a..de6163d 100644 --- a/goldlib/gall/gcharset.cpp +++ b/goldlib/gall/gcharset.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #ifdef __WIN32__ @@ -113,6 +114,14 @@ const char *get_dos_charset(const char *cpfrom) if(strieql(cpfrom, cpmap[i].from)) return cpmap[i].to; } + #if defined(__unix__) + char* lang = getenv("LANG"); + if( lang && strncmp(lang,"ru_RU",4) ) { + return "CP866"; + }else{ + return "CP437"; + } + #endif return ""; #endif }