Antonio Scuri <antonio.sc...@gmail.com>于2018年7月18日周三 下午6:15写道:
> Hi Wu,
>
> Now I'm closer to understand what's going on. But I still need to dig
> deeper.
>
> The files you sent are not in UTF-8, right? You did not converted to
> UTF-8, you just converted the representation from ANSI to hexadecimal.
> (ignoring the comments in the files)
>
Yes. And I convert Latin characters in comments to UTF-8.
>
> Although being harmless, it turns maintenance of these strings more
> difficult. I wouldn't like that.
>
> Reading the documentation in the Microsoft link you sent, another
> possibility is to write in the beginning of the file:
>
> #ifdef _MSC_VER
> #pragma setlocale(“.1252”)
> #endif
>
> At least for Visual C++.
>
> This solves the problem for you?
>
>
I'm working on a cross-platform project, msvc 's problem is a part of it,
and I can't compile it on mingw/gcc :( and pragma has some compatibility
problems (between different msvc versions).
I would like to see change iup_str.c first, because I saw it already use
some code point numbers instead of Latin characters like
mm(129)=249; mm(141)=250; mm(143)=251; mm(144)=252; mm(157)=253;
mm(160)=254; mm(173)=255;
Why not do it to other none-portable characters ? This map (mm) seems not
maintain by hand.
For iupmatex_units.c , I agree it turns maintenance more difficult. I
suggest using a macro to improve it.
/* MU is 'µ' */
#define MU_LATIN '\xB5'
/* DEGREE is '°' */
#define DEGREE_LATIN '\xB0'
#define DEGREE_UTF8 "\xC2\xBA"
{"microsecond", MU_LATIN "s", 1.0e-6, "\xC2\xB5s"}};
{"degree Celsius" , DEGREE_LATIN "C" , 1, DEGREE_UTF8 "C"},
{"degree Fahrenheit", DEGREE_LATIN "F" , 5./9., DEGREE_UTF8 "F"},
...
------------------------------------------------------------------------------
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
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users