Andrew Robinson <[email protected]>于2018年7月18日周三 上午6:03写道:

> Cloud Wu,
>
> Absolutely not. In order for IUP to work with all OSes, it cannot use
> UTF-8 because Microsoft only fully supports UTF-16. The lowest common
> denominator are the ANSI Latin code pages.
>
>
>
I'm sorry that I didn't make myself clear.

My opinion is using ASCII only in source code rather than ANSI latin code
page ( code page 1252) . The utf-8 text only exist in comments that would
be ignored by almost compilers.

The issue of cp1252 is that many compilers would recognize the input source
depend on os current locale , so when system locale is not cp1252, it
raises a compile error. msvc has this behavior [1] , and some version of
gcc will also recognize this Latin char as UTF-8 char by default (at least
in my environment).

Although we can use some command line options or pragma to specify the
source character set, but it's different between the compilers, So I think
the lowest common denominator are ASCII (code point 32-127) rather than
ANSI Latin code pages.

My patch in original post is only change these Latin characters in string
literal to number (for example, from  mm('£')= 80 to mm(163)=80 ) or using
escape character  like "\xB5" instead of "µ" . I convert some Latin
character in comments to utf-8 because it would be more friendly to modern
editors ,and  it will not affect the compiler (even the old one).

Would you please reconsider my patch ?

[1] :
https://blogs.msdn.microsoft.com/vcblog/2016/02/22/new-options-for-managing-character-sets-in-the-microsoft-cc-compiler/
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to