diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-04-09 08:20:10 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-04-09 08:20:10 +0000 |
commit | f03f51dccf606bd9ba89991e67132bf58e6fcdf0 (patch) | |
tree | fd0e778389d53ab59247ed98cffb4e7467b7022d /newlib/libc/stdlib/wctomb_r.c | |
parent | 712789c794c6b0fa3c3ae1867aaa73dc4480b50e (diff) | |
download | cygnal-f03f51dccf606bd9ba89991e67132bf58e6fcdf0.tar.gz cygnal-f03f51dccf606bd9ba89991e67132bf58e6fcdf0.tar.bz2 cygnal-f03f51dccf606bd9ba89991e67132bf58e6fcdf0.zip |
* libc/stdlib/mbctype.h (_iseucjp1): Like _iseucjp, but also
recognizes 0x8e and 0x8f lead bytes.
(_iseucjp2): Rename from _iseucjp.
* libc/stdlib/mbtowc_r.c (__eucjp_mbtowc): Convert JIS-X-0212
triplebyte sequences as well.
* libc/stdlib/wctomb_r.c (__eucjp_wctomb): Convert to JIS-X-0212
triplebyte sequences as well.
Diffstat (limited to 'newlib/libc/stdlib/wctomb_r.c')
-rw-r--r-- | newlib/libc/stdlib/wctomb_r.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/newlib/libc/stdlib/wctomb_r.c b/newlib/libc/stdlib/wctomb_r.c index 64210f232..95a04069c 100644 --- a/newlib/libc/stdlib/wctomb_r.c +++ b/newlib/libc/stdlib/wctomb_r.c @@ -195,12 +195,19 @@ _DEFUN (__eucjp_wctomb, (r, s, wchar, charset, state), if (char1 != 0x00) { /* first byte is non-zero..validate multi-byte char */ - if (_iseucjp (char1) && _iseucjp (char2)) + if (_iseucjp1 (char1) && _iseucjp2 (char2)) { *s++ = (char)char1; *s = (char)char2; return 2; } + else if (_iseucjp2 (char1) && _iseucjp2 (char2 | 0x80)) + { + *s++ = (char)0x8f; + *s++ = (char)char1; + *s = (char)(char2 | 0x80); + return 3; + } else { r->_errno = EILSEQ; |