[PATCH/RFA] Revamp wctomb/mbtowc conversion, add more charset support

Corinna Vinschen vinschen@redhat.com
Fri Mar 20 19:27:00 GMT 2009

On Mar 20 13:22, Jeff Johnston wrote:
> Corinna Vinschen wrote:
>> On Mar 20 13:00, Corinna Vinschen wrote:
>> 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.
> If only Cygwin will use these, flag them Cygwin or segregate them to  
> sys/cygwin.  Otherwise you will need to add configuration options for  

I don't think that only Cygwin will use them.  They are not
Cygwin-specific.  All of these charsets/codepages are defined at
least on Linux as well.  They are very useful if you have to expect
input from a source which used these codepages, like a text created on a
Windows machine.

> specifying them so that the default will be current behavior (and  
> current size).  The option(s) would be comma seperated and could take a  
> value of "all" to indicate all are enabled.  You should also make the  
> option default like other configure.host options so that Cygwin can  
> default to "all" and it doesn't require specification on the configure  
> line.  The iconv translation tables have similar options already in  
> newlib/configure.in.

Oh :(  This is way more complicated than I had imagined.  In that case
I'd rather just define the additional iso and Windows codepage tables
and code for __CYGWIN__ only for now.  Would that be ok?

Or, couldn't we define just a single additional setting like, say
_MB_EXTENDED_CHARSETS, which can be set in config.h in a target-specific


Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

More information about the Newlib mailing list