Re: Cygwin 1.7.1 sprintf() with format string having 8th bit set

2010-01-04 Thread Andy Koppe
2010/1/4 Joseph Quinsey: > 1) In my bad test, I already had my LOCALE set to C.ASCII: > >   env | grep LC >   LC_ALL=C.ASCII To use the locale set in the environment you need to invoke setlocale(LC_CTYPE, ""), i.e. with an empty string as the second parameter. Without a setlocale call, your progra

Re: Cygwin 1.7.1 sprintf() with format string having 8th bit set

2010-01-04 Thread Andy Koppe
2010/1/4 Thomas Wolff: > My assumption has been that *printf should be byte-transparent unless where > it uses explicit wide character arguments. What's that assumption based on? > After all, legacy applications that do not care about locales at all may > legitimately assume this since a C char

RE: Cygwin 1.7.1 sprintf() with format string having 8th bit set

2010-01-04 Thread Joseph Quinsey
Hello, Thank you Andy for your help. As per your suggestion, the problem was resolved by adding the line: setlocale (LC_CTYPE, "C.ASCII"); My actual code was something like: #define CSI_ "\233" ... sprintf (..., CSI_"%d;%dH", row, col); So my problem is fixed. But as a matter

Re: Cygwin 1.7.1 sprintf() with format string having 8th bit set

2010-01-04 Thread Thomas Wolff
Andy Koppe wrote: 2010/1/4 Joseph Quinsey In Cygwin 1,7.1, sprintf() with the format string having an 8th bit set appears to be broken. Sample code (where I've indicated the backslashes in the comments, in case they are stripped out by the mailer): #include int main (void) { unsigned ch

Re: Cygwin 1.7.1 sprintf() with format string having 8th bit set

2010-01-04 Thread Andy Koppe
2010/1/4 Joseph Quinsey > In Cygwin 1,7.1, sprintf() with the format string having an 8th bit set > appears to be broken. Sample code (where I've indicated the backslashes in > the comments, in case they are stripped out by the mailer): > > #include > > int main (void) > { >    unsigned char foo[3

Cygwin 1.7.1 sprintf() with format string having 8th bit set

2010-01-03 Thread Joseph Quinsey
Hello, In Cygwin 1,7.1, sprintf() with the format string having an 8th bit set appears to be broken. Sample code (where I've indicated the backslashes in the comments, in case they are stripped out by the mailer): #include int main (void) { unsigned char foo[30] = ""; unsigned char bar[