summaryrefslogtreecommitdiff
path: root/lingucomponent/source/lingutil/lingutil.cxx
diff options
context:
space:
mode:
authorDaniel Rentz [dr] <daniel.rentz@oracle.com>2010-12-09 10:13:55 +0100
committerDaniel Rentz [dr] <daniel.rentz@oracle.com>2010-12-09 10:13:55 +0100
commitb8c0bb8307498d9f78d14c81e4bae482ce8825b3 (patch)
tree9e1cd93fb2ce38190b131fa020ed59438a25ac5c /lingucomponent/source/lingutil/lingutil.cxx
parent65db01a81bae6922c9aed8d99ba3bfbcc1526538 (diff)
parent082cd85b058e66a3b99e66f8c75ed8d013370958 (diff)
mib19: rebase to DEV300m95
Diffstat (limited to 'lingucomponent/source/lingutil/lingutil.cxx')
-rw-r--r--lingucomponent/source/lingutil/lingutil.cxx21
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;
+}
+
//////////////////////////////////////////////////////////////////////