https://bugs.freedesktop.org/show_bug.cgi?id=59642

--- Comment #12 from Mike Kaganski <mikekagan...@hotmail.com> ---
(In reply to comment #10)
> Do you know if the LO has code to avoid this marker, or maybe handle this?

Here is what I found:

http://docs.libreoffice.org/tools/html/classSvStream.html#ab1d78e3df7058ca99859cb43d3b227a6

sal_Bool SvStream::StartReadingUnicodeText(rtl_TextEncoding eReadBomCharSet)

If eReadBomCharSet==RTL_TEXTENCODING_DONTKNOW: read 16bit, if 0xfeff do nothing
(UTF-16), if 0xfffe switch endian swapping (UTF-16), if 0xefbb or 0xbbef read
another byte and check for UTF-8. 

If no UTF-* BOM was detected put all read bytes back. This means that if 2
bytes were read it was an UTF-16 BOM, if 3 bytes were read it was an UTF-8 BOM.
There is no UTF-7, UTF-32 or UTF-EBCDIC BOM detection!

If eReadBomCharSet!=RTL_TEXTENCODING_DONTKNOW: only read a BOM of that encoding
and switch endian swapping if UTF-16 and 0xfffe.

===
The pStrm is SvStream*, so everything seems as easy as adding this just before
line 316 of smdetect.cxx
http://cgit.freedesktop.org/libreoffice/core/tree/starmath/source/smdetect.cxx#n316
:
pStrm->StartReadingUnicodeText(RTL_TEXTENCODING_DONTKNOW);
sal_uLong nBytesRead = pStrm->Read( aBuffer, nSize );

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to