Returning to the original issue of string encoding in source:

This needn't be a Windows/non-Windows problem, or UTF-8 vs. -16, or any other conflict over platform and standard compatibility.

I encountered the string encoding problem just last month when I worked on porting IUP to a system using the Clang compiler; the following is more of a summary of the problem and its workaround than anything which hasn't already been discovered or acknowledged in this thread:

   The intent in iup_str.c and iup_strmessage.c appears to be that the
   exact byte or byte string between quotes be copied into the constant
   string data compiled into the library: the compiler should not try
   to reinterpret the byte sequences in any way; this is the job of
   IUP, the OS, and/or third-party libraries at run-time.

   However, not all compilers expect to use character and string
   literals in this way.  The lowest common denominator of various ways
   a compiler may try to interpret the string may be reasonably assumed
   to be ASCII, therefore any bytes in range 128-255 should be
   represented using escapes rather than pasted directly in the source.

   So although Cloud Wu suggested converting source encoding "from
   ISO8859-1 to UTF-8", the intent is to restrict source itself to
   ASCII (no UTF-8!), while preserving the raw byte strings the source
   intends to represent in whichever ISO8859-1/UTF-8/UTF-16 encoding is
   already used.

   If done correctly, this would not change the compiled library in any
   way.


The remaining issue, of course, is this:

On 07/18/18 07:06, 云风 Cloud Wu wrote:
Antonio Scuri <antonio.sc...@gmail.com <mailto:antonio.sc...@gmail.com>>于2018年7月18日周三 下午6:15写道:

      Although being harmless, it turns maintenance of these strings
    more difficult. I wouldn't like that.


For iupmatex_units.c , I agree it turns maintenance more difficult. I suggest using a macro to improve it.


A potentially cleaner solution is to maintain a single master file of string constants, encoded in whatever encoding is preferred for editing, and to generate the relevant parts of iup*_str*, iup*_units*, etc. programmatically.

In porting IUP to FreeBSD, where Clang compiler is default and preferred, I used small conversion programs to convert the string literals as needed.  These are attached.  Once compiled, the conversion utilities read source from stdin and write adjusted source to stdout.

Should the IUP project insist on continuing to release iup_str.c and iup_strmessage.c with the existing mixed-encoding literals, these conversion utilities would need to become part of the routine procedure for the maintainer of the FreeBSD port to import upstream changes.  (This also applies to a port of IUP to MacOS, another system where Clang is default.  More on this later...)  Instead of maintaining this conversion scheme independently, it seems sensible to try to integrate this with the master IUP project.  In the interest of making IUP more portable across diverse platforms, I would be happy to help with this.

Theron
#include <stdio.h>
#include <string.h>

int main (int argc, char * *argv) {
  FILE * input = stdin;
  FILE * output = stdout;
  char c[3];
  fread(&c[0], 1, 3, input);
  while (!feof(input)) {
    if (c[0]=='\'' && c[2]=='\'') {
      if (c[1]>127u) {
        char p[4];
        snprintf(p, 4, "%03u", (unsigned char)c[1]);
        memcpy(c, p, 3);
      }
    }
    fwrite(&c[0], 1, 1, output);
    memmove(&c[0], &c[1], 2);
    fread(&c[2], 1, 1, input);
  }
  fwrite(&c[0], 1, 2, output);
  return 0;
}
--- src/iup_str.c.orig	2018-04-29 14:58:02 UTC
+++ src/iup_str.c
@@ -1226,20 +1226,20 @@ static void iStrInitLatin1_map(void)
 
   mm(  0)=  0;  mm(  1)=  1; mm(  2)=  2; mm(  3)=  3; mm(  4)=  4; mm(  5)=  5; mm(  6)=  6; mm(  7)=  7;  mm(  8)=  8; mm(  9)=  9; mm( 10)= 10; mm( 11)= 11; mm( 12)= 12; mm( 13)= 13; mm( 14)= 14; mm( 15)= 15; 
   mm( 16)= 16;  mm( 17)= 17; mm( 18)= 18; mm( 19)= 19; mm( 20)= 20; mm( 21)= 21; mm( 22)= 22; mm( 23)= 23;  mm( 24)= 24; mm( 25)= 25; mm( 26)= 26; mm( 27)= 27; mm( 28)= 28; mm( 29)= 29; mm( 30)= 30; mm( 31)= 31; 
-  mm('\'')= 32; mm('-')= 33; mm('–')= 34; mm('—')= 35; mm(' ')= 36; mm('!')= 37; mm('"')= 38; mm('#')= 39;  mm('$')= 40; mm('%')= 41; mm('&')= 42; mm('(')= 43; mm(')')= 44; mm('*')= 45; mm(',')= 46; mm('.')= 47; 
-  mm('/')= 48;  mm(':')= 49; mm(';')= 50; mm('?')= 51; mm('@')= 52; mm('(')= 53; mm(')')= 54; mm('^')= 55;  mm('ˆ')= 56; mm('_')= 57; mm('`')= 58; mm('{')= 59; mm('|')= 60; mm('}')= 61; mm('~')= 62; mm('¡')= 63; 
-  mm('¦')= 64;  mm('¨')= 65; mm('¯')= 66; mm('´')= 67; mm('¸')= 68; mm('¿')= 69; mm('˜')= 70; mm('‘')= 71;  mm('’')= 72; mm('‚')= 73; mm('“')= 74; mm('”')= 75; mm('„')= 76; mm('‹')= 77; mm('›')= 78; mm('¢')= 79; 
-  mm('£')= 80;  mm('¤')= 81; mm('¥')= 82; mm('€')= 83; mm('+')= 84; mm('<')= 85; mm('=')= 86; mm('>')= 87;  mm('±')= 88; mm('«')= 89; mm('»')= 90; mm('×')= 91; mm('÷')= 92; mm('§')= 93; mm('©')= 94; mm('¬')= 95; 
-  mm('®')= 96;  mm('°')= 97; mm('µ')= 98; mm('¶')= 99; mm('…')=100; mm('†')=101; mm('‡')=102; mm('•')=103;  mm('•')=104; mm('‰')=105; mm('0')=106; mm('¼')=107; mm('½')=108; mm('¾')=109; mm('1')=110; mm('¹')=111; 
-  mm('2')=112;  mm('²')=113; mm('3')=114; mm('³')=115; mm('4')=116; mm('5')=117; mm('6')=118; mm('7')=119;  mm('8')=120; mm('9')=121; mm('a')=122; mm('A')=123; mm('ª')=124; mm('á')=125; mm('Á')=126; mm('à')=127; 
-  mm('À')=128;  mm('â')=129; mm('Â')=130; mm('ä')=131; mm('Ä')=132; mm('ã')=133; mm('Ã')=134; mm('å')=135;  mm('Å')=136; mm('æ')=137; mm('Æ')=138; mm('b')=139; mm('B')=140; mm('c')=141; mm('C')=142; mm('ç')=143; 
-  mm('Ç')=144;  mm('d')=145; mm('D')=146; mm('ð')=147; mm('Ð')=148; mm('e')=149; mm('E')=150; mm('é')=151;  mm('É')=152; mm('è')=153; mm('È')=154; mm('ê')=155; mm('Ê')=156; mm('ë')=157; mm('Ë')=158; mm('f')=159; 
-  mm('F')=160;  mm('ƒ')=161; mm('g')=162; mm('G')=163; mm('h')=164; mm('H')=165; mm('i')=166; mm('I')=167;  mm('í')=168; mm('Í')=169; mm('ì')=170; mm('Ì')=171; mm('î')=172; mm('Î')=173; mm('ï')=174; mm('Ï')=175; 
-  mm('j')=176;  mm('J')=177; mm('k')=178; mm('K')=179; mm('l')=180; mm('L')=181; mm('m')=182; mm('M')=183;  mm('n')=184; mm('N')=185; mm('ñ')=186; mm('Ñ')=187; mm('o')=188; mm('O')=189; mm('º')=190; mm('ó')=191; 
-  mm('Ó')=192;  mm('ò')=193; mm('Ò')=194; mm('ô')=195; mm('Ô')=196; mm('ö')=197; mm('Ö')=198; mm('õ')=199;  mm('Õ')=200; mm('ø')=201; mm('Ø')=202; mm('œ')=203; mm('Œ')=204; mm('p')=205; mm('P')=206; mm('q')=207; 
-  mm('Q')=208;  mm('r')=209; mm('R')=210; mm('s')=211; mm('S')=212; mm('š')=213; mm('Š')=214; mm('ß')=215;  mm('t')=216; mm('T')=217; mm('þ')=218; mm('Þ')=219; mm('™')=220; mm('u')=221; mm('U')=222; mm('ú')=223; 
-  mm('Ú')=224;  mm('ù')=225; mm('Ù')=226; mm('û')=227; mm('Û')=228; mm('ü')=229; mm('Ü')=230; mm('v')=231;  mm('V')=232; mm('w')=233; mm('W')=234; mm('x')=235; mm('X')=236; mm('y')=237; mm('Y')=238; mm('ý')=239; 
-  mm('Ý')=240;  mm('ÿ')=241; mm('Ÿ')=242; mm('z')=243; mm('Z')=244; mm('ž')=245; mm('Ž')=246; mm('\\')=247; mm(127)=248; mm(129)=249; mm(141)=250; mm(143)=251; mm(144)=252; mm(157)=253; mm(160)=254; mm(173)=255; 
+  mm('\'')= 32; mm('-')= 33; mm(150)= 34; mm(151)= 35; mm(' ')= 36; mm('!')= 37; mm('"')= 38; mm('#')= 39;  mm('$')= 40; mm('%')= 41; mm('&')= 42; mm('(')= 43; mm(')')= 44; mm('*')= 45; mm(',')= 46; mm('.')= 47; 
+  mm('/')= 48;  mm(':')= 49; mm(';')= 50; mm('?')= 51; mm('@')= 52; mm('(')= 53; mm(')')= 54; mm('^')= 55;  mm(136)= 56; mm('_')= 57; mm('`')= 58; mm('{')= 59; mm('|')= 60; mm('}')= 61; mm('~')= 62; mm(161)= 63; 
+  mm(166)= 64;  mm(168)= 65; mm(175)= 66; mm(180)= 67; mm(184)= 68; mm(191)= 69; mm(152)= 70; mm(145)= 71;  mm(146)= 72; mm(130)= 73; mm(147)= 74; mm(148)= 75; mm(132)= 76; mm(139)= 77; mm(155)= 78; mm(162)= 79; 
+  mm(163)= 80;  mm(164)= 81; mm(165)= 82; mm(128)= 83; mm('+')= 84; mm('<')= 85; mm('=')= 86; mm('>')= 87;  mm(177)= 88; mm(171)= 89; mm(187)= 90; mm(215)= 91; mm(247)= 92; mm(167)= 93; mm(169)= 94; mm(172)= 95; 
+  mm(174)= 96;  mm(176)= 97; mm(181)= 98; mm(182)= 99; mm(133)=100; mm(134)=101; mm(135)=102; mm(149)=103;  mm(149)=104; mm(137)=105; mm('0')=106; mm(188)=107; mm(189)=108; mm(190)=109; mm('1')=110; mm(185)=111; 
+  mm('2')=112;  mm(178)=113; mm('3')=114; mm(179)=115; mm('4')=116; mm('5')=117; mm('6')=118; mm('7')=119;  mm('8')=120; mm('9')=121; mm('a')=122; mm('A')=123; mm(170)=124; mm(225)=125; mm(193)=126; mm(224)=127; 
+  mm(192)=128;  mm(226)=129; mm(194)=130; mm(228)=131; mm(196)=132; mm(227)=133; mm(195)=134; mm(229)=135;  mm(197)=136; mm(230)=137; mm(198)=138; mm('b')=139; mm('B')=140; mm('c')=141; mm('C')=142; mm(231)=143; 
+  mm(199)=144;  mm('d')=145; mm('D')=146; mm(240)=147; mm(208)=148; mm('e')=149; mm('E')=150; mm(233)=151;  mm(201)=152; mm(232)=153; mm(200)=154; mm(234)=155; mm(202)=156; mm(235)=157; mm(203)=158; mm('f')=159; 
+  mm('F')=160;  mm(131)=161; mm('g')=162; mm('G')=163; mm('h')=164; mm('H')=165; mm('i')=166; mm('I')=167;  mm(237)=168; mm(205)=169; mm(236)=170; mm(204)=171; mm(238)=172; mm(206)=173; mm(239)=174; mm(207)=175; 
+  mm('j')=176;  mm('J')=177; mm('k')=178; mm('K')=179; mm('l')=180; mm('L')=181; mm('m')=182; mm('M')=183;  mm('n')=184; mm('N')=185; mm(241)=186; mm(209)=187; mm('o')=188; mm('O')=189; mm(186)=190; mm(243)=191; 
+  mm(211)=192;  mm(242)=193; mm(210)=194; mm(244)=195; mm(212)=196; mm(246)=197; mm(214)=198; mm(245)=199;  mm(213)=200; mm(248)=201; mm(216)=202; mm(156)=203; mm(140)=204; mm('p')=205; mm('P')=206; mm('q')=207; 
+  mm('Q')=208;  mm('r')=209; mm('R')=210; mm('s')=211; mm('S')=212; mm(154)=213; mm(138)=214; mm(223)=215;  mm('t')=216; mm('T')=217; mm(254)=218; mm(222)=219; mm(153)=220; mm('u')=221; mm('U')=222; mm(250)=223; 
+  mm(218)=224;  mm(249)=225; mm(217)=226; mm(251)=227; mm(219)=228; mm(252)=229; mm(220)=230; mm('v')=231;  mm('V')=232; mm('w')=233; mm('W')=234; mm('x')=235; mm('X')=236; mm('y')=237; mm('Y')=238; mm(253)=239; 
+  mm(221)=240;  mm(255)=241; mm(159)=242; mm('z')=243; mm('Z')=244; mm(158)=245; mm(142)=246; mm('\\')=247; mm(127)=248; mm(129)=249; mm(141)=250; mm(143)=251; mm(144)=252; mm(157)=253; mm(160)=254; mm(173)=255; 
 
 #undef mm
 
@@ -1248,20 +1248,20 @@ static void iStrInitLatin1_map(void)
   /* here case differences use the same code */
   mm(  0)=  0;  mm(  1)=  1; mm(  2)=  2; mm(  3)=  3; mm(  4)=  4; mm(  5)=  5; mm(  6)=  6; mm(  7)=  7;  mm(  8)=  8; mm(  9)=  9; mm( 10)= 10; mm( 11)= 11; mm( 12)= 12; mm( 13)= 13; mm( 14)= 14; mm( 15)= 15; 
   mm( 16)= 16;  mm( 17)= 17; mm( 18)= 18; mm( 19)= 19; mm( 20)= 20; mm( 21)= 21; mm( 22)= 22; mm( 23)= 23;  mm( 24)= 24; mm( 25)= 25; mm( 26)= 26; mm( 27)= 27; mm( 28)= 28; mm( 29)= 29; mm( 30)= 30; mm( 31)= 31; 
-  mm('\'')= 32; mm('-')= 33; mm('–')= 34; mm('—')= 35; mm(' ')= 36; mm('!')= 37; mm('"')= 38; mm('#')= 39;  mm('$')= 40; mm('%')= 41; mm('&')= 42; mm('(')= 43; mm(')')= 44; mm('*')= 45; mm(',')= 46; mm('.')= 47; 
-  mm('/')= 48;  mm(':')= 49; mm(';')= 50; mm('?')= 51; mm('@')= 52; mm('(')= 53; mm(')')= 54; mm('^')= 55;  mm('ˆ')= 56; mm('_')= 57; mm('`')= 58; mm('{')= 59; mm('|')= 60; mm('}')= 61; mm('~')= 62; mm('¡')= 63; 
-  mm('¦')= 64;  mm('¨')= 65; mm('¯')= 66; mm('´')= 67; mm('¸')= 68; mm('¿')= 69; mm('˜')= 70; mm('‘')= 71;  mm('’')= 72; mm('‚')= 73; mm('“')= 74; mm('”')= 75; mm('„')= 76; mm('‹')= 77; mm('›')= 78; mm('¢')= 79; 
-  mm('£')= 80;  mm('¤')= 81; mm('¥')= 82; mm('€')= 83; mm('+')= 84; mm('<')= 85; mm('=')= 86; mm('>')= 87;  mm('±')= 88; mm('«')= 89; mm('»')= 90; mm('×')= 91; mm('÷')= 92; mm('§')= 93; mm('©')= 94; mm('¬')= 95; 
-  mm('®')= 96;  mm('°')= 97; mm('µ')= 98; mm('¶')= 99; mm('…')=100; mm('†')=101; mm('‡')=102; mm('•')=103;  mm('•')=104; mm('‰')=105; mm('0')=106; mm('¼')=107; mm('½')=108; mm('¾')=109; mm('1')=110; mm('¹')=111; 
-  mm('2')=112;  mm('²')=113; mm('3')=114; mm('³')=115; mm('4')=116; mm('5')=117; mm('6')=118; mm('7')=119;  mm('8')=120; mm('9')=121; mm('a')=122; mm('A')=122; mm('ª')=124; mm('á')=125; mm('Á')=125; mm('à')=127; 
-  mm('À')=127;  mm('â')=129; mm('Â')=129; mm('ä')=131; mm('Ä')=131; mm('ã')=133; mm('Ã')=133; mm('å')=135;  mm('Å')=135; mm('æ')=137; mm('Æ')=137; mm('b')=139; mm('B')=139; mm('c')=141; mm('C')=141; mm('ç')=143; 
-  mm('Ç')=143;  mm('d')=145; mm('D')=145; mm('ð')=147; mm('Ð')=147; mm('e')=149; mm('E')=149; mm('é')=151;  mm('É')=151; mm('è')=153; mm('È')=153; mm('ê')=155; mm('Ê')=155; mm('ë')=157; mm('Ë')=157; mm('f')=159; 
-  mm('F')=159;  mm('ƒ')=161; mm('g')=162; mm('G')=162; mm('h')=164; mm('H')=164; mm('i')=166; mm('I')=166;  mm('í')=168; mm('Í')=168; mm('ì')=170; mm('Ì')=170; mm('î')=172; mm('Î')=172; mm('ï')=174; mm('Ï')=174; 
-  mm('j')=176;  mm('J')=176; mm('k')=178; mm('K')=178; mm('l')=180; mm('L')=180; mm('m')=182; mm('M')=182;  mm('n')=184; mm('N')=184; mm('ñ')=186; mm('Ñ')=186; mm('o')=188; mm('O')=188; mm('º')=190; mm('ó')=191; 
-  mm('Ó')=191;  mm('ò')=193; mm('Ò')=193; mm('ô')=195; mm('Ô')=195; mm('ö')=197; mm('Ö')=197; mm('õ')=199;  mm('Õ')=199; mm('ø')=201; mm('Ø')=201; mm('œ')=203; mm('Œ')=203; mm('p')=205; mm('P')=205; mm('q')=207; 
-  mm('Q')=207;  mm('r')=209; mm('R')=209; mm('s')=211; mm('S')=211; mm('š')=213; mm('Š')=213; mm('ß')=215;  mm('t')=216; mm('T')=216; mm('þ')=218; mm('Þ')=218; mm('™')=220; mm('u')=221; mm('U')=221; mm('ú')=223; 
-  mm('Ú')=223;  mm('ù')=225; mm('Ù')=225; mm('û')=227; mm('Û')=227; mm('ü')=229; mm('Ü')=229; mm('v')=231;  mm('V')=231; mm('w')=233; mm('W')=233; mm('x')=235; mm('X')=235; mm('y')=237; mm('Y')=237; mm('ý')=239; 
-  mm('Ý')=239;  mm('ÿ')=241; mm('Ÿ')=241; mm('z')=243; mm('Z')=243; mm('ž')=245; mm('Ž')=245; mm('\\')=247; mm(127)=248; mm(129)=249; mm(141)=250; mm(143)=251; mm(144)=252; mm(157)=253; mm(160)=254; mm(173)=255; 
+  mm('\'')= 32; mm('-')= 33; mm(150)= 34; mm(151)= 35; mm(' ')= 36; mm('!')= 37; mm('"')= 38; mm('#')= 39;  mm('$')= 40; mm('%')= 41; mm('&')= 42; mm('(')= 43; mm(')')= 44; mm('*')= 45; mm(',')= 46; mm('.')= 47; 
+  mm('/')= 48;  mm(':')= 49; mm(';')= 50; mm('?')= 51; mm('@')= 52; mm('(')= 53; mm(')')= 54; mm('^')= 55;  mm(136)= 56; mm('_')= 57; mm('`')= 58; mm('{')= 59; mm('|')= 60; mm('}')= 61; mm('~')= 62; mm(161)= 63; 
+  mm(166)= 64;  mm(168)= 65; mm(175)= 66; mm(180)= 67; mm(184)= 68; mm(191)= 69; mm(152)= 70; mm(145)= 71;  mm(146)= 72; mm(130)= 73; mm(147)= 74; mm(148)= 75; mm(132)= 76; mm(139)= 77; mm(155)= 78; mm(162)= 79; 
+  mm(163)= 80;  mm(164)= 81; mm(165)= 82; mm(128)= 83; mm('+')= 84; mm('<')= 85; mm('=')= 86; mm('>')= 87;  mm(177)= 88; mm(171)= 89; mm(187)= 90; mm(215)= 91; mm(247)= 92; mm(167)= 93; mm(169)= 94; mm(172)= 95; 
+  mm(174)= 96;  mm(176)= 97; mm(181)= 98; mm(182)= 99; mm(133)=100; mm(134)=101; mm(135)=102; mm(149)=103;  mm(149)=104; mm(137)=105; mm('0')=106; mm(188)=107; mm(189)=108; mm(190)=109; mm('1')=110; mm(185)=111; 
+  mm('2')=112;  mm(178)=113; mm('3')=114; mm(179)=115; mm('4')=116; mm('5')=117; mm('6')=118; mm('7')=119;  mm('8')=120; mm('9')=121; mm('a')=122; mm('A')=122; mm(170)=124; mm(225)=125; mm(193)=125; mm(224)=127; 
+  mm(192)=127;  mm(226)=129; mm(194)=129; mm(228)=131; mm(196)=131; mm(227)=133; mm(195)=133; mm(229)=135;  mm(197)=135; mm(230)=137; mm(198)=137; mm('b')=139; mm('B')=139; mm('c')=141; mm('C')=141; mm(231)=143; 
+  mm(199)=143;  mm('d')=145; mm('D')=145; mm(240)=147; mm(208)=147; mm('e')=149; mm('E')=149; mm(233)=151;  mm(201)=151; mm(232)=153; mm(200)=153; mm(234)=155; mm(202)=155; mm(235)=157; mm(203)=157; mm('f')=159; 
+  mm('F')=159;  mm(131)=161; mm('g')=162; mm('G')=162; mm('h')=164; mm('H')=164; mm('i')=166; mm('I')=166;  mm(237)=168; mm(205)=168; mm(236)=170; mm(204)=170; mm(238)=172; mm(206)=172; mm(239)=174; mm(207)=174; 
+  mm('j')=176;  mm('J')=176; mm('k')=178; mm('K')=178; mm('l')=180; mm('L')=180; mm('m')=182; mm('M')=182;  mm('n')=184; mm('N')=184; mm(241)=186; mm(209)=186; mm('o')=188; mm('O')=188; mm(186)=190; mm(243)=191; 
+  mm(211)=191;  mm(242)=193; mm(210)=193; mm(244)=195; mm(212)=195; mm(246)=197; mm(214)=197; mm(245)=199;  mm(213)=199; mm(248)=201; mm(216)=201; mm(156)=203; mm(140)=203; mm('p')=205; mm('P')=205; mm('q')=207; 
+  mm('Q')=207;  mm('r')=209; mm('R')=209; mm('s')=211; mm('S')=211; mm(154)=213; mm(138)=213; mm(223)=215;  mm('t')=216; mm('T')=216; mm(254)=218; mm(222)=218; mm(153)=220; mm('u')=221; mm('U')=221; mm(250)=223; 
+  mm(218)=223;  mm(249)=225; mm(217)=225; mm(251)=227; mm(219)=227; mm(252)=229; mm(220)=229; mm('v')=231;  mm('V')=231; mm('w')=233; mm('W')=233; mm('x')=235; mm('X')=235; mm('y')=237; mm('Y')=237; mm(253)=239; 
+  mm(221)=239;  mm(255)=241; mm(159)=241; mm('z')=243; mm('Z')=243; mm(158)=245; mm(142)=245; mm('\\')=247; mm(127)=248; mm(129)=249; mm(141)=250; mm(143)=251; mm(144)=252; mm(157)=253; mm(160)=254; mm(173)=255; 
 
 #undef mm
 }
--- src/iup_strmessage.c.orig	2017-12-11 16:52:44 UTC
+++ src/iup_strmessage.c
@@ -111,44 +111,44 @@ typedef struct _IstdMessage
 static IstdMessage iStdMessages[] =
 {
   {"IUP_ERROR", {"Error!", "Erro!", NULL, "Error!", NULL, NULL}},
-  {"IUP_ATTENTION", {"Attention!", "Atenção!", "Atenção!", "¡Advertencia!", "¡Advertencia!", NULL}},
+  {"IUP_ATTENTION", {"Attention!", "Aten\xe7""\xe3""o!", "Aten\xc3""\xa7""\xc3""\xa3""o!", "\xa1""Advertencia!", "\xc2""\xa1""Advertencia!", NULL}},
   {"IUP_YES", {"Yes", "Sim", NULL, "Si", NULL, NULL}},
-  {"IUP_NO", {"No", "Não", "Não", "No", NULL, NULL}},
-  {"IUP_INVALIDDIR", {"Invalid directory.", "Diretório inválido.", "Diretório inválido.", "Directorio inválido.", "Directorio inválido.", NULL}},
-  {"IUP_FILEISDIR", {"The selected name is a directory.", "O nome selecionado é um diretório.", "O nome selecionado é um diretório.", "El nombre seleccionado es un directorio.", NULL, NULL}},
+  {"IUP_NO", {"No", "N\xe3""o", "N\xc3""\xa3""o", "No", NULL, NULL}},
+  {"IUP_INVALIDDIR", {"Invalid directory.", "Diret\xf3""rio inv\xe1""lido.", "Diret\xc3""\xb3""rio inv\xc3""\xa1""lido.", "Directorio inv\xe1""lido.", "Directorio inv\xc3""\xa1""lido.", NULL}},
+  {"IUP_FILEISDIR", {"The selected name is a directory.", "O nome selecionado \xe9"" um diret\xf3""rio.", "O nome selecionado \xc3""\xa9"" um diret\xc3""\xb3""rio.", "El nombre seleccionado es un directorio.", NULL, NULL}},
   {"IUP_FILENOTEXIST", {"File does not exist.", "Arquivo inexistente.", NULL, "Archivo inexistente.", NULL, NULL}},
-  {"IUP_FILEOVERWRITE", {"Overwrite existing file?", "Sobrescrever arquivo?", NULL, "¿Sobrescribir archivo?", "¿Sobrescribir archivo?", NULL}},
-  {"IUP_CREATEFOLDER", {"Create Folder", "Criar Diretório", "Criar Diretório", "Crear Directorio", NULL, NULL}},
-  {"IUP_NAMENEWFOLDER", {"Name of the new folder:", "Nome do novo diretório:", "Nome do novo diretório:", "Nombre del nuevo directorio:", NULL, NULL}},
+  {"IUP_FILEOVERWRITE", {"Overwrite existing file?", "Sobrescrever arquivo?", NULL, "\xbf""Sobrescribir archivo?", "\xc2""\xbf""Sobrescribir archivo?", NULL}},
+  {"IUP_CREATEFOLDER", {"Create Folder", "Criar Diret\xf3""rio", "Criar Diret\xc3""\xb3""rio", "Crear Directorio", NULL, NULL}},
+  {"IUP_NAMENEWFOLDER", {"Name of the new folder:", "Nome do novo diret\xf3""rio:", "Nome do novo diret\xc3""\xb3""rio:", "Nombre del nuevo directorio:", NULL, NULL}},
   {"IUP_SAVEAS", {"Save As", "Salvar Como", NULL, "Guardar Como", NULL, NULL}},
   {"IUP_OPEN", {"Open", "Abrir", NULL, "Abrir", NULL, NULL}},
-  {"IUP_SELECTDIR", {"Select Directory", "Selecionar Diretório", "Selecionar Diretório", "Seleccionar Directorio", NULL, NULL}},
+  {"IUP_SELECTDIR", {"Select Directory", "Selecionar Diret\xf3""rio", "Selecionar Diret\xc3""\xb3""rio", "Seleccionar Directorio", NULL, NULL}},
   {"IUP_OK", {"OK", "OK", NULL, "Aceptar", NULL, NULL}},
   {"IUP_CANCEL", {"Cancel", "Cancelar", NULL, "Cancelar", NULL, NULL}},
   {"IUP_RETRY", {"Retry", "Tentar Novamente", NULL, "Reintentar", NULL, NULL}},
   {"IUP_APPLY", {"Apply", "Aplicar", NULL, "Aplicar", NULL, NULL}},
   {"IUP_RESET", {"Reset", "Reinicializar", NULL, "Reiniciar", NULL, NULL}},
-  {"IUP_GETCOLOR", {"Color Selection", "Seleção de Cor", "Seleção de Cor", "Selección de Color", "Selección de Color", NULL}},
+  {"IUP_GETCOLOR", {"Color Selection", "Sele\xe7""\xe3""o de Cor", "Sele\xc3""\xa7""\xc3""\xa3""o de Cor", "Selecci\xf3""n de Color", "Selecci\xc3""\xb3""n de Color", NULL}},
   {"IUP_HELP", {"Help", "Ajuda", NULL, "Ayuda", NULL, NULL}},
   {"IUP_RED", {"&Red:", "&Vermelho:", NULL, "&Rojo:", NULL, NULL}},
   {"IUP_GREEN", {"&Green:", "V&erde:", NULL, "&Verde:", NULL, NULL}},
   {"IUP_BLUE", {"&Blue:", "&Azul:", NULL, "&Azul:", NULL, NULL}},
   {"IUP_HUE", {"&Hue:", "&Matiz:", NULL, "&Matiz:", NULL, NULL}},
-  {"IUP_SATURATION", {"&Saturation:", "&Saturação:", "&Saturação:", "&Saturación:", "&Saturación:", NULL}},
+  {"IUP_SATURATION", {"&Saturation:", "&Satura\xe7""\xe3""o:", "&Satura\xc3""\xa7""\xc3""\xa3""o:", "&Saturaci\xf3""n:", "&Saturaci\xc3""\xb3""n:", NULL}},
   {"IUP_INTENSITY", {"&Intensity:", NULL, "&Intensidade:", "&Intensidad:", NULL, NULL}},
   {"IUP_OPACITY", {"&Opacity:", "&Opacidade:", NULL, "&Opacidad:", NULL, NULL}},
   {"IUP_PALETTE", {"&Palette:", "&Paleta:", NULL, "&Paleta:", NULL, NULL}},
   {"IUP_TRUE", {"True", "Verdadeiro", NULL, "Verdadero", NULL, NULL}},
   {"IUP_FALSE", {"False", "Falso", NULL, "Falso", NULL, NULL}},
-  {"IUP_FAMILY", {"Family:", "Família:", "Família:", "Familia:", NULL, NULL}},
+  {"IUP_FAMILY", {"Family:", "Fam\xed""lia:", "Fam\xc3""\xad""lia:", "Familia:", NULL, NULL}},
   {"IUP_STYLE", {"Style:", "Estilo:", NULL, "Estilo:", NULL, NULL}},
-  {"IUP_SIZE", {"Size:", "Tamanho:", NULL, "Tamaño:", "Tamaño:", NULL}},
+  {"IUP_SIZE", {"Size:", "Tamanho:", NULL, "Tama\xf1""o:", "Tama\xc3""\xb1""o:", NULL}},
   {"IUP_SAMPLE", {"Sample:", "Exemplo:", NULL, "Ejemplo:", NULL, NULL}},
   {"IUP_ERRORFILEOPEN", { "Failed to open file.", "Falha ao abrir o arquivo.", NULL, "Error al abrir el archivo.", NULL, NULL } },
   {"IUP_ERRORFILESAVE", { "Failed to save file.", "Falha ao salvar o arquivo.", NULL, "Error al guardar el archivo.", NULL, NULL } },
   { "IUP_LUAERROR", { "Lua Error", "Erro de Lua", NULL, "Error de Lua", NULL, NULL } },
-  { "IUP_CONTINUE", { "Continue", "Continuar", NULL, "Continúe", "Continúe", NULL } },
-  { "IUP_COPYTOCLIPBOARD", { "Copy text to clipboard.", "Copiar texto para a área de transferência.", "Copiar texto para a área de transferência.", "Copiar texto para un área de transferencia.", "Copiar texto para un área de transferencia.", NULL } },
+  { "IUP_CONTINUE", { "Continue", "Continuar", NULL, "Contin\xfa""e", "Contin\xc3""\xba""e", NULL } },
+  { "IUP_COPYTOCLIPBOARD", { "Copy text to clipboard.", "Copiar texto para a \xe1""rea de transfer\xea""ncia.", "Copiar texto para a \xc3""\xa1""rea de transfer\xc3""\xaa""ncia.", "Copiar texto para un \xe1""rea de transferencia.", "Copiar texto para un \xc3""\xa1""rea de transferencia.", NULL } },
   { "IUP_COPY", { "Copy", "Copiar", NULL, "Copiar", NULL, NULL } },
   { "IUP_EXIT", { "Exit", "Sair", NULL, "Salir", NULL, NULL } },
   { NULL, { NULL, NULL, NULL, NULL, NULL, NULL } }
@@ -191,3 +191,4 @@ void iupStrMessageUpdateLanguage(const char* language)
   iStrMessageRegisterInternal(lng, utf8mode);
   iupRegisterUpdateClasses();
 }
+
/* WARNING: Although this conversion routine works as intended for characters
     within string literals, it also affects any bytes > 127 outside of
     string literals, which is not intended but remains to be fixed.
*/

#include <stdio.h>
#include <string.h>

int main (int argc, char * *argv) {
  FILE * input = stdin;
  FILE * output = stdout;
  char c;
  while (!feof(input)) {
    fread(&c, 1, 1, input);
    if (c>127u) {
      fprintf(output, "\\x%02x\"\"", (unsigned char)c);
    } else {
      fwrite(&c, 1, 1, output);
    }
  }
  return 0;
}
------------------------------------------------------------------------------
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

Reply via email to