summaryrefslogtreecommitdiff
path: root/lingucomponent/source/lingutil/lingutil.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'lingucomponent/source/lingutil/lingutil.cxx')
-rwxr-xr-x[-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 5e8b0489f..0f286292b 100644..100755
--- a/lingucomponent/source/lingutil/lingutil.cxx
+++ b/lingucomponent/source/lingutil/lingutil.cxx
@@ -51,6 +51,7 @@
#include <unotools/pathoptions.hxx>
#include <rtl/ustring.hxx>
#include <rtl/string.hxx>
+#include <rtl/tencinfo.h>
#include <linguistic/misc.hxx>
#include <set>
@@ -263,6 +264,26 @@ 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;
+}
+
//////////////////////////////////////////////////////////////////////
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */