summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-04-27 18:02:08 +0200
committerEike Rathke <erack@redhat.com>2016-04-27 18:06:32 +0200
commit0445de5e0d9bccd7634911ca3547c0e14f4f47c5 (patch)
tree97fb02139e3d1f7337fba9641c12be578d03e1d4
parent817c3b17fa57a7c4c4f80569bc00a21001fb6807 (diff)
accept UTF8 as explicit charset value
... to follow the (wrong) docs on the net.. it doesn't harm. Change-Id: I30c34edb6dc1c56084625de8e52bfb5afe82fcf7
-rw-r--r--sc/source/core/data/global.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index e9df0052ab26..b878817e0f9e 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -676,6 +676,11 @@ rtl_TextEncoding ScGlobal::GetCharsetValue( const OUString& rCharSet )
else if (rCharSet.equalsIgnoreAsciiCase("IBMPC_861")) return RTL_TEXTENCODING_IBM_861;
else if (rCharSet.equalsIgnoreAsciiCase("IBMPC_863")) return RTL_TEXTENCODING_IBM_863;
else if (rCharSet.equalsIgnoreAsciiCase("IBMPC_865")) return RTL_TEXTENCODING_IBM_865;
+ // Some wrong "help" on the net mentions UTF8 and even unoconv uses it,
+ // which worked accidentally if the system encoding is UTF-8 anyway, so
+ // support it ;) but only when reading.
+ else if (rCharSet.equalsIgnoreAsciiCase("UTF8")) return RTL_TEXTENCODING_UTF8;
+ else if (rCharSet.equalsIgnoreAsciiCase("UTF-8")) return RTL_TEXTENCODING_UTF8;
else return osl_getThreadTextEncoding();
}