This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: Cygwin 1.7.1 sprintf() with format string having 8th bit set
- From: "Joseph Quinsey" <jquinsey at entrenet dot com>
- To: <cygwin at cygwin dot com>
- Date: Mon, 4 Jan 2010 10:07:44 -0500
- Subject: RE: Cygwin 1.7.1 sprintf() with format string having 8th bit set
- References:
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 of general interest, there are still some oddities:
1) In my bad test, I already had my LOCALE set to C.ASCII:
env | grep LC
LC_ALL=C.ASCII
I'm using tcsh(1), if this matters. And this setting generates a nuisance
message "locale not supported by Xlib, locale set to C" whenever I start
nedit. And $LANG is ASCII, if this matters.
2) The call setlocale (LC_CTYPE, "C") did not work, although it returns its
second argument.
3) The call setlocale (LC_CTYPE, "POSIX") also did not work. It happens to
return "C".
The above behaviour seems to disagree with the man page.
Thank you again for your very prompt help.
Regards, Joe Quinsey
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple