diff options
author | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2010-12-09 10:13:55 +0100 |
---|---|---|
committer | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2010-12-09 10:13:55 +0100 |
commit | b8c0bb8307498d9f78d14c81e4bae482ce8825b3 (patch) | |
tree | 9e1cd93fb2ce38190b131fa020ed59438a25ac5c /lingucomponent/source/lingutil/lingutil.cxx | |
parent | 65db01a81bae6922c9aed8d99ba3bfbcc1526538 (diff) | |
parent | 082cd85b058e66a3b99e66f8c75ed8d013370958 (diff) |
mib19: rebase to DEV300m95
Diffstat (limited to 'lingucomponent/source/lingutil/lingutil.cxx')
-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 ee7d71de4435..14253fca5cd3 100644 --- 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; +} + ////////////////////////////////////////////////////////////////////// |