This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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 program will use the initial
locale: "C".


> And this setting generates a nuisance
> message "locale not supported by Xlib, locale set to C" whenever I start
> nedit.

Yep, unfortunately X has its own ideas of what valid locales are,
independent of Cygwin's. Therefore you should set a locale with an
actual language, e.g. "en_US.ISO-8859-1". (X probably won't accept the
.ASCII either.)


> And $LANG is ASCII, if this matters.

That's an invalid setting, i.e. it should be in the same
"language.charset" format. But it doesn't matter because LC_ALL takes
priority.


> 2) The call setlocale (LC_CTYPE, "C") did not work, although it returns its
> second argument.

That's because the "C" locale is what's already selected at program startup.


> 3) The call setlocale (LC_CTYPE, "POSIX") also did not work. It happens to
> return "C".

"POSIX" is just a synonym for "C".


> The above behaviour seems to disagree with the man page.

Which man page?

Andy

--
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]