This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: [PATCH/RFA] Revamp wctomb/mbtowc conversion, add more charset support


On Mar 20 13:00, Corinna Vinschen wrote:
> Hi,
> 
> this is a rather big patch which is split in two due to the 100K
> mail size restriction on sourceware.  What it does is this:
> 
> - Add support for correct ISO-8859-x charset handling.
> 
> - Add support for a couple of default ANSI codepages used on Windows,
>   CP737, CP775, CP1125, CP1250, CP1251, CP1252, CP1253, CP1254, CP1255,
>   CP1256, CP1257, CP1258.
> 
> These new charsets require a couple of new character conversion tables
> which I put into a new file called libc/stdlib/sb_charsets.c, and which
> are only built on _MB_CAPABLE systems.  The complete size of these new
> tables is 5760 bytes on systems with sizeof(wchar_t)==2, 11520 bytes on
> sizeof(wchar_t)==4 systems.  I think that's not too much.
> Size-constraint systems will not build with _MB_CAPABLE anyway.

In the meantime I found that I have to add support for the Windows
codepages 720, 850, 852, 855, 857, 858, 862, 866 and 874 as well,
to work correctly in certain scenarios on Cygwin.  In my local
copy of the patch I just added these codepages unconditionally in
the _MB_CAPABLE case.  This raises the size of the translation tables
to 8320 or 16640 bytes, dependent on sizeof (wchar_t).

If you want me to disable certain translation tables and charsets
when not building for Cygwin, feel free to give me a set of unwanted
charsets.

What's missing for full Windows support are the double byte charsets 932
(GBK), 936 (Korean) and 950 (Big5).  I'm planning to add support for
these codepages at one point, but if anybody has code to contribute this
stuff, I'd be really glad.


Corinna


-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


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