X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <061d01ca1866$0f881db0$2e985910$@com> References: <061d01ca1866$0f881db0$2e985910$@com> Date: Sat, 8 Aug 2009 21:48:38 +0100 Message-ID: <416096c60908081348v45812d88y5b6cc9be9635923b@mail.gmail.com> Subject: Re: converting to wide characters From: Andy Koppe To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT 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