This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: converting to wide characters
- From: Andy Koppe <andy dot koppe at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Sat, 8 Aug 2009 21:48:38 +0100
- Subject: Re: converting to wide characters
- References: <061d01ca1866$0f881db0$2e985910$@com>
2009/8/8 Tony Lewis:
> According to the documentation, passing an empty string to iconv denotes
> locale dependent character encoding. This leads me to conclude that by
> default on cygwin:
>
> cd = iconv_open("UTF-16LE", "");
>
> should produce the same encodings as:
>
> cd = iconv_open("UTF-16LE", "ISO-8859-1");
Nope, the default codepage on Cygwin is your Windows' default "ANSI"
codepage, i.e. probably 1252.
> but it doesn't for characters in the range 0x80 to 0x9f. Is there a way to
> set my locale within cygwin so that "" means "ISO-8859-1" to iconv_open?
Cygwin 1.7's setlocale() reads the standard environment variables:
LC_ALL, LC_CTYPE, LANG. (On Cygwin 1.5 there's a codepage setting in
the CYGWIN variable, but I don't think that affects setlocale().)
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