Hi Theron, >How is a compiler that rejects bytes 128-255 in string literals >necessarily non-conforming?...Now, knowing that not all compilers >in practice do accept this cleanly.
As you yourself pointed out in an earlier message, "the compiler should not try to reinterpret the byte sequences in any way". That is a truism and since the problem only exists in some compilers and not others, it would make more sense to switch compilers rather switch code just so those certain compilers that don't work with iup_str.c would suddenly start working. >The strings themselves should not ever need editing to "make it work". >As long as the strings are already correctly encoded ISO8859-1 and >UTF-8 There is no such thing as "correctly encoded" C-strings, only valid or invalid C-strings. Here are a few examples of some valid C-strings: char s1[] = "a中z"; // <-- fully supported by MS char s1[] = u8"a中z"; char16_t s1[] = u"a中z"; char32_t s1[] = U"a中z"; wchar_t s1[] = L"a中z"; // <-- fully supported by MS Just don't forget to setlocale() so as to be able to use them with printf() and a few other functions like that. >To make my own position clear: The conversion routines I hacked together >should *NOT* be used in production. They are only meant as minimalist >examples of one sort of solution which could be attempted, although it >would very much need to be made more robust and, of course, less hacked. I'm not trying to criticize your code, I'm trying to say instead of editing the code, try using a different compiler that won't give you errors that shouldn't exist. >The sort of general solution I would like to see for this class of >problem is a tool for copying exact byte strings, read from a file, into >constants data of compiled object, which can then be linked into library >to make such constants available. For portability, this might involve >expanding the strings into escape sequences understood to C compiler, >but the user(developer) shouldn't be burdened with this detail. Does >such a thing exist? No, and that sounds so very over-complicated to maintain doing it like that. ASCII and ANSI are so yesterday, so why are they still hanging around causing problems? Regards, Andrew ------------------------------------------------------------------------------ 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
