libiconv for windres
Kai Tietz
Kai.Tietz@onevision.com
Fri Jun 1 09:52:00 GMT 2007
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
More information about the Binutils
mailing list