[KoCo-CVS] [Commit] iconvcodec _iconv_codec.c
Brought to you by:
perky
From: Hye-Shik C. <pe...@us...> - 2003-06-11 12:35:31
|
perky 03/06/11 05:35:30 Modified: . _iconv_codec.c Log: Count 0xfe and 0xff as single-byte sequence. Revision Changes Path 1.11 +4 -3 iconvcodec/_iconv_codec.c Index: _iconv_codec.c =================================================================== RCS file: /cvsroot/koco/iconvcodec/_iconv_codec.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- _iconv_codec.c 11 Jun 2003 12:30:38 -0000 1.10 +++ _iconv_codec.c 11 Jun 2003 12:35:23 -0000 1.11 @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _iconv_codec.c,v 1.10 2003/06/11 12:30:38 perky Exp $ + * $Id: _iconv_codec.c,v 1.11 2003/06/11 12:35:23 perky Exp $ */ #include "Python.h" @@ -230,7 +230,8 @@ else if (*(p) < 0xf0) (p) += 3; \ else if (*(p) < 0xf8) (p) += 4; \ else if (*(p) < 0xfc) (p) += 5; \ - else (p) += 6; + else if (*(p) < 0xfe) (p) += 6; \ + else (p)++; static const unsigned char * skipchars_utf8(const unsigned char *st, int n) @@ -1066,7 +1067,7 @@ | ((ucs4_t)(ubuf[3] ^ 0x80) << 6) | (ucs4_t)(ubuf[4] ^ 0x80); ubuf += 5; - } else if (*ubuf < 0xff) { + } else if (*ubuf < 0xfe) { if (uleft < 6 || !((ubuf[1] ^ 0x80) < 0x40 && (ubuf[2] ^ 0x80) < 0x40 && (ubuf[3] ^ 0x80) < 0x40 && (ubuf[4] ^ 0x80) < 0x40 && (ubuf[5] ^ 0x80) < 0x40 && |