This is the mail archive of the newlib@sources.redhat.com 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: Question


mail_lists@mail.ru wrote:
Hello.

Would anybody explain me please, why __jp2uc() call is needed in
newlib-1.11.0/newlib/libc/ctype/iswalpha.c, lines 80, 85, 90.

As I understand, this is a conversion from JIS, SJIS and EUCJP to
Unicode. But, wide characters are independent from any encoding type
and are usually already represented by Unicode.

Thanks.
Artem.


The answer is historical. Unicode support wasn't added until later. The JIS, SJIS, and EUCJP wchar_t support was initially added as part of an embedded processor contract back in the Cygnus Solutions days. To minimize the footprint, the implementation chose to convert into simple double-byte characters based on the initial character set; the effect being that one couldn't convert from one character set into wchar_t and then back into another.

Now that we have unicode support, we could add a __uc2jp function and then use that function and __jp2uc
when converting.  This could be under the control of configuration such that smaller existing platforms
could still use the old design.

-- Jeff J.


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