Created attachment 81737 [details] Full error message This is a regression of https://issues.apache.org/ooo/show_bug.cgi?id=76970 Step to reproduce on Windows XP 1. Open "Control Panel" -> "Regional and Language Options" 2. Select "Languages" tab 3. Check "Install files for East Asian languages" 4. Select "Advanced" tab 5. Select "Japanese" of "Language for non-Unicode programs" 6. Check "932 (ANSI/OEM - Japanese Shift-JIS)" of "Code page conversion tables" 7. Restart computer 8. Start to build libreoffice 9. The Build will fail with following message $ /opt/lo/bin/make /opt/lo/bin/make -j 1 -rs -f C:/libo/Makefile.gbuild [build DEP] LNK:Library/ivcl.lib [build CXX] vcl/win/source/window/keynames.cxx C:/libo/vcl/win/source/window/keynames.cxx : warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss C:/libo/vcl/win/source/window/keynames.cxx(126) : error C2001: newline in constant (snip) make[1]: *** [C:/libo/workdir/wntmsci13.pro/CxxObject/vcl/win/source/window/keynames.o] Error 2 make: *** [build] Error 2 Full error message is attached. Also same error occurs on Windows 8.
Created attachment 81739 [details] Patch for adding BOM Its reason is that MSVC interprets UTF-8 source code without BOM as local codepage (ACP). Attached patch adds BOM and fixes this problem. I know that BOM for UTF-8 is redudant and not recommended. But it's only method to compile UTF-8 source normally in both GCC and MSVC with some codepage. Please review the patch.
See also: Unicode Support in the Compiler and Linker http://msdn.microsoft.com/en-us/library/xwy0e8f2%28v=vs.110%29.aspx
Also escaping UTF-8 chars fixes this. But it makes source code unreadable in this case. For example in sw/qa/extras/rtfexport/rtfexport.cpp:320 "sum from {n = 1} to {∞}" will be converted to "sum from {n = 1} to {\x81\x87}" For that reason, I think adding BOM is bit better than escaping UTF-8 chars.
Confirmed commit is def32c7e14ad9743e2b55804442be5d596f6c21c
I put it at New since this issue has been reproduced. I won't say it's a dup of fdo#66246 but rather say a more generic issue.
Sorry for lack of my search skill. I will copy these comments and attachments to fdo#66246 if there is an administrative problem.
Isamu: no problem! your contribution to the fix of this bug is indeed far more important that some triaging point:-)
Julien: Thanks for your help. I'll continue to write things to this issue.
Patch was uploaded to https://gerrit.libreoffice.org/#/c/4270/ . It is waiting for reviews.
Patch was merged. Thanks!
Oh.. patch was reverted. I'll search more better fix.
Fixed by: http://cgit.freedesktop.org/libreoffice/core/commit/?id=c7a8462b839f37712620fd2c236cfda026ec546d http://cgit.freedesktop.org/libreoffice/core/commit/?id=610265284d11c14c98c2874fabfc06b9aaeb0349 http://cgit.freedesktop.org/libreoffice/core/commit/?id=3e48277e36a485d964d7b91305b1bf70a83c4451 http://cgit.freedesktop.org/libreoffice/core/commit/?id=c7a8462b839f37712620fd2c236cfda026ec546d http://cgit.freedesktop.org/libreoffice/core/commit/?id=4980d1acdf1498e9fd8cc0d6c31c2b8184c4439a Thanks!