CYGWIN=codepage? Or LC_CTYPE=foo?

Kazuhiro Fujieda
Sun Apr 6 15:06:00 GMT 2008

>>> On Sun, 06 Apr 2008 13:13:55 +0200
>>> Corinna Vinschen said:

> So, given my vague understanding of this language stuff, the conversion
> from wide char to multibyte string *can* be based on the notion the
> applications have of the language/codepage.  Which sounds to me as if
> using LANG/LC_CTYPE would also make sense for Cygwin's internal
> conversions.
> Does that make sense?  I don't know.  No. 5: "More input, please!"

Your understanding is quite right.

> I would be basically fine with that, we just have to replace the
> newlib functions _mbtowc_r and _wctomb_r.  All other conversions are
> based on these.  What we still also need is a good conversion
> function from LANG/LC_CTYPE to Windows codepage.
> And here's the problem:  I don't think I understand this stuff good
> enough.  Does anybody have fun and time to come up with that?

I can help you.

>>> On Sun, 06 Apr 2008 13:47:34 +0200
>>> Corinna Vinschen said:

> Not quite, unfortunately.  iswalpha, iswblank, iswcntrl, iswprint,
> iswpunct, iswspace, towlower and towupper also need a bit of work.

Actually I implemented these functions several years ago for
Cygwin DLL 1.3.12. These functions are implemented by Win32 API.

>>> On Sun, 06 Apr 2008 14:02:59 +0200
>>> Corinna Vinschen said:

> Gee!  strcoll, strxfrm, wcscoll and wcsxfrm are also candidates,
> of course.

They are categorized into LC_COLLATE. I have the implementations

> Wouldn't it make sense to use, say, FreeBSD code for the character stuff
> throughout?  Even for the sys_wcstombs and sys_mbstowcs functions?
> Of so, would anybody like to help to work on this?

Windows knows about processing characters well. We can implement
the C library functions processing characters with Win32 API.
I will reform the implementations and contribute them by the end
of this month, possibly.
  | AIST      Kazuhiro Fujieda <>
  | HOKURIKU  School of Information Science
o_/ 1990      Japan Advanced Institute of Science and Technology

More information about the Cygwin-developers mailing list