diff --git a/uppsrc/Core/CharSet.cpp b/uppsrc/Core/CharSet.cpp index 8e178ddc2..ff4a0e94d 100644 --- a/uppsrc/Core/CharSet.cpp +++ b/uppsrc/Core/CharSet.cpp @@ -2128,9 +2128,12 @@ int CharsetByName(const char *name) String nm = Filter(name, cs_filter); if(nm == "utf8" || nm == "utf-8") return CHARSET_UTF8; - for(int i = 1; i < CharsetCount(); i++) - if(nm == Filter(CharsetName(i), cs_filter)) - return i; + for(int pass = 0; pass < 2; pass++) { + for(int i = 1; i < CharsetCount(); i++) + if(nm == Filter(CharsetName(i), cs_filter)) + return i; + nm.Replace("win", "windows"); + } return 0; } diff --git a/uppsrc/Core/Lang.cpp b/uppsrc/Core/Lang.cpp index d936d2c28..2f9d7ed11 100644 --- a/uppsrc/Core/Lang.cpp +++ b/uppsrc/Core/Lang.cpp @@ -154,6 +154,16 @@ void SetLanguage(int lang) { SetCurrentLanguage(lang); } +void SetLanguage(const char *s) +{ + SetLanguage(LNGFromText(s)); +} + +String GetCurrentLanguageString() +{ + return LNGAsText(GetCurrentLanguage()); +} + String GetLangName(int language) { return GetLanguageInfo(language).english_name; diff --git a/uppsrc/Core/Lang.h b/uppsrc/Core/Lang.h index fb11c075f..5cf302b5e 100644 --- a/uppsrc/Core/Lang.h +++ b/uppsrc/Core/Lang.h @@ -21,6 +21,9 @@ int SetLNGCharset(int lng, byte chrset); void SetLanguage(int lang); int GetCurrentLanguage(); +void SetLanguage(const char *s); +String GetCurrentLanguageString(); + int GetSystemLNG(); VectorMap GetLanguage(int lang);//rename...