bug-gnu-libiconv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnu-libiconv] Remove Unicode characters in include/iconv.h.in


From: Feiyun Wang
Subject: Re: [bug-gnu-libiconv] Remove Unicode characters in include/iconv.h.in
Date: Sat, 2 Dec 2017 09:48:54 +0000 (UTC)

Sorry forget my workaround script. See the attached.


Feiyun Wang <address@hidden> 于 2017年12月2日, 星期六, 下午 5:40 写道:


Hi,

I suggest to revert this patch which added UTF-8 characters in include/iconv.h.in:
> From 3a8897944d46577d349993b6ffbfeaa45597152d Mon Sep 17 00:00:00 2001
> From: Bruno Haible <address@hidden>
> Date: Tue, 16 Sep 2008 23:37:17 +0000
> Subject: [PATCH] Use Unicode single-quotes in comments.

UTF-8 in source files will cause warning C4819 for non-English MSVC users.
It often comes with other serious errors as source files are not properly handled, even when it happens in code comments.
It caused libiconv failed to build on my Cygwin-MSVC Chinese Windows build.
Some inelegant solutions could be:
1. Change the Windows system locale to English before using MSVC;
2. Before "make", convert include/iconv.h file encoding from utf-8 to the system codepage. Like this:
 if[ ! `regtool -q check /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Nls/CodePage/OEMCP` ];then
  TOCODEPAGE=`regtool get /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Nls/CodePage/OEMCP`
  cp include/iconv.h include/iconv.h.backup
  iconv-c -f utf-8 -t cp"${TOCODEPAGE}" include/iconv.h 1>include/iconv.h.tmp
  mv include/iconv.h.tmp include/iconv.h
  make
  make check
  make install
  mv include/iconv.h.backup include/iconv.h
3. "/utf-8" added in CFLAGS and CXXFLAGS:
See "configure" command in the attached script. I take this workaround for now.
Anyhow, revert the above patch will be the easiest way.

[3] /utf-8 (Set Source and Executable character sets to UTF-8)
https://msdn.microsoft.com/en-us/library/mt708821.aspx
[4] Unicode Support in the Compiler and Linker
https://msdn.microsoft.com/en-us/library/xwy0e8f2.aspx

Sincerely,
Feiyun Wang



Attachment: build-vc2017.sh
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]