[Libreoffice-commits] core.git: filter/source svtools/source
Stephan Bergmann
sbergman at redhat.com
Tue Oct 11 15:14:21 UTC 2016
filter/source/msfilter/rtfutil.cxx | 8 ++++++++
svtools/source/svrtf/rtfout.cxx | 8 ++++++++
2 files changed, 16 insertions(+)
New commits:
commit 12ec109de01c31605cf412612903190e469be8ff
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Oct 11 17:11:38 2016 +0200
Comment about state of non-BMP Unicode chars in RTF
Change-Id: I90051425c52f42f69cd61436979a50b875cca710
diff --git a/filter/source/msfilter/rtfutil.cxx b/filter/source/msfilter/rtfutil.cxx
index e5c07e3..32e04fa 100644
--- a/filter/source/msfilter/rtfutil.cxx
+++ b/filter/source/msfilter/rtfutil.cxx
@@ -37,6 +37,14 @@ OString OutHex(sal_uLong nHex, sal_uInt8 nLen)
return OString(pStr);
}
+// Ideally, this function should work on (sal_uInt32) Unicode scalar values
+// instead of (sal_Unicode) UTF-16 code units. However, at least "Rich Text
+// Format (RTF) Specification Version 1.9.1" available at
+// <https://www.microsoft.com/en-us/download/details.aspx?id=10725> does not
+// look like it allows non-BMP Unicode characters >= 0x10000 in the \uN notation
+// (it only talks about "Unicode character", but then explains how values of N
+// greater than 32767 will be expressed as negative signed 16-bit numbers, so
+// that smells like \uN is limited to BMP).
OString OutChar(sal_Unicode c, int* pUCMode, rtl_TextEncoding eDestEnc, bool* pSuccess, bool bUnicode)
{
if (pSuccess)
diff --git a/svtools/source/svrtf/rtfout.cxx b/svtools/source/svrtf/rtfout.cxx
index 62979aa..f64c3c8 100644
--- a/svtools/source/svrtf/rtfout.cxx
+++ b/svtools/source/svrtf/rtfout.cxx
@@ -46,6 +46,14 @@ SvStream& Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 nLen )
return rStream.WriteCharPtr( pStr );
}
+// Ideally, this function should work on (sal_uInt32) Unicode scalar values
+// instead of (sal_Unicode) UTF-16 code units. However, at least "Rich Text
+// Format (RTF) Specification Version 1.9.1" available at
+// <https://www.microsoft.com/en-us/download/details.aspx?id=10725> does not
+// look like it allows non-BMP Unicode characters >= 0x10000 in the \uN notation
+// (it only talks about "Unicode character", but then explains how values of N
+// greater than 32767 will be expressed as negative signed 16-bit numbers, so
+// that smells like \uN is limited to BMP).
SvStream& Out_Char(SvStream& rStream, sal_Unicode c,
int *pUCMode, rtl_TextEncoding eDestEnc, bool bWriteHelpFile)
{
More information about the Libreoffice-commits
mailing list