summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-09-05 09:57:32 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-09-05 11:11:29 +0200
commit411e4d15ff278c4fec77126f29916b5600aefbfb (patch)
tree0271a55f143993b7ce07ba0d19764b9d2ff5568b
parente8acfdb4428523e10fe63728f36bc0d8ddd9a9d8 (diff)
Fix conversion of U+0000 in ImplUnicodeToDBCS
...which appears to have been broken when 13824735057ef25075af8fd0ddb8f14e34c7eeb6 "#81346# - Fix for unconverted characters for DBCS encodings" moved that "if" out of surrounding "if" block. (And, for consistency, write the "if" check in the same way as the preceding one is written since 739cb04c36524c5a1bbf768dfe93624a1b2ec8b4 "#97705# Fixed mapping of Big5 EUDC points.") Change-Id: I4324197c4eba671ab6313fb89f988da102b8ffa5 Reviewed-on: https://gerrit.libreoffice.org/78627 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--sal/qa/rtl/textenc/rtl_textcvt.cxx9
-rw-r--r--sal/textenc/tcvtmb.cxx2
2 files changed, 10 insertions, 1 deletions
diff --git a/sal/qa/rtl/textenc/rtl_textcvt.cxx b/sal/qa/rtl/textenc/rtl_textcvt.cxx
index af9ccca345e7..068e727d53cb 100644
--- a/sal/qa/rtl/textenc/rtl_textcvt.cxx
+++ b/sal/qa/rtl/textenc/rtl_textcvt.cxx
@@ -1765,6 +1765,15 @@ void Test::testComplex() {
RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
#if WITH_LOCALE_ALL || WITH_LOCALE_ja
{ RTL_TEXTENCODING_SHIFT_JIS,
+ RTL_CONSTASCII_STRINGPARAM("\x00"),
+ {0x0000},
+ 1,
+ true,
+ true,
+ true,
+ false,
+ RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
+ { RTL_TEXTENCODING_SHIFT_JIS,
RTL_CONSTASCII_STRINGPARAM(
"\x87\x40\x87\x41\x87\x42\x87\x43\x87\x44\x87\x45\x87\x46"
"\x87\x47\x87\x48\x87\x49\x87\x4A\x87\x4B\x87\x4C\x87\x4D"
diff --git a/sal/textenc/tcvtmb.cxx b/sal/textenc/tcvtmb.cxx
index 4e990cc1e91e..89e89c56c628 100644
--- a/sal/textenc/tcvtmb.cxx
+++ b/sal/textenc/tcvtmb.cxx
@@ -320,7 +320,7 @@ sal_Size ImplUnicodeToDBCS( const void* pData, SAL_UNUSED_PARAMETER void*,
}
}
- if ( !cConv )
+ if (cConv == 0 && c != 0)
{
if ( nFlags & RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACE )
{