diff options
Diffstat (limited to 'lingucomponent/source/lingutil/lingutil.cxx')
-rwxr-xr-x[-rw-r--r--] | lingucomponent/source/lingutil/lingutil.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx index 142fc4f7b..15c019a14 100644..100755 --- a/lingucomponent/source/lingutil/lingutil.cxx +++ b/lingucomponent/source/lingutil/lingutil.cxx @@ -50,6 +50,7 @@ #include <unotools/pathoptions.hxx> #include <rtl/ustring.hxx> #include <rtl/string.hxx> +#include <rtl/tencinfo.h> #include <linguistic/misc.hxx> #include <set> @@ -268,5 +269,25 @@ void MergeNewStyleDicsAndOldStyleDics( } } + +rtl_TextEncoding getTextEncodingFromCharset(const sal_Char* pCharset) +{ + // default result: used to indicate that we failed to get the proper encoding + rtl_TextEncoding eRet = RTL_TEXTENCODING_DONTKNOW; + + if (pCharset) + { + eRet = rtl_getTextEncodingFromMimeCharset(pCharset); + if (eRet == RTL_TEXTENCODING_DONTKNOW) + eRet = rtl_getTextEncodingFromUnixCharset(pCharset); + if (eRet == RTL_TEXTENCODING_DONTKNOW) + { + if (strcmp("ISCII-DEVANAGARI", pCharset) == 0) + eRet = RTL_TEXTENCODING_ISCII_DEVANAGARI; + } + } + return eRet; +} + ////////////////////////////////////////////////////////////////////// |