This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: libiconv for windres
- From: Kai Tietz <Kai dot Tietz at onevision dot com>
- To: Danny Smith <dannysmith at clear dot net dot nz>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 1 Jun 2007 11:51:32 +0200
- Subject: RE: libiconv for windres
Hi Danny,
> Why is this table necessary on windows?
> +/* Languages supported. */
> +static const wind_language_t languages[] =
> +{
> ....
> We can fetch the codepage from the language id by
> using the windows API in winnt.h
> and avoid having to resync when supported LANG,SUBLANG pairs change
>
>
> static unsigned int
> codepage_from_langid (unsigned short langid)
> {
> #define max_cp_string_len 6
> char cp_string [max_cp_string_len];
> int c;
> memset (cp_string, 0, max_cp_string_len);
> /* LOCALE_RETURN_NUMBER flag would avoid strtoul conversion,
> but is unavailable on Win95. */
> c = GetLocaleInfoA (MAKELCID (langid, SORT_DEFAULT),
> LOCALE_IDEFAULTANSICODEPAGE,
> cp_string, max_cp_string_len);
> /* If codepage data for an LCID is not installed on users's system,
> GetLocaleInfo returns an empty string. Fall back to system ANSI
> default. */
> if ( c == 0 )
> return CP_ACP;
> return strtoul (cp_string, 0, 10);
> }
Ok, I will use your method for _WIN32. An other question is, should we use
iconv even on cygwin, or should we use on cygwin also the windows API ?
Also I will replace in winduni.c the use of HAVE_ICONV_H by HAVE_ICONV. I
think this is more correct.
Cheers,
i.A. Kai Tietz
| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.
------------------------------------------------------------------------------------------
OneVision Software Entwicklungs GmbH & Co. KG
Dr.-Leo-Ritter-StraÃe 9 - 93049 Regensburg
Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
Handelsregister: HRA 6744, Amtsgericht Regensburg
KomplementÃrin: OneVision Software Entwicklungs Verwaltungs GmbH
Dr.-Leo-Ritter-StraÃe 9 â 93049 Regensburg
Handelsregister: HRB 8932, Amtsgericht Regensburg - GeschÃftsfÃhrer:
Ulrike DÃhler, Manuela Kluger