[KoCo-CVS] [Commit] cjkcodecs/src _euc_jisx0213.c
Brought to you by:
perky
From: Hye-Shik C. <pe...@us...> - 2003-07-08 04:58:36
|
perky 03/07/07 21:58:35 Modified: src _euc_jisx0213.c Log: Don't try to encode extended planes other than U+20000 Revision Changes Path 1.4 +7 -9 cjkcodecs/src/_euc_jisx0213.c Index: _euc_jisx0213.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_euc_jisx0213.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- _euc_jisx0213.c 8 Jul 2003 04:40:43 -0000 1.3 +++ _euc_jisx0213.c 8 Jul 2003 04:58:35 -0000 1.4 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: _euc_jisx0213.c,v 1.3 2003/07/08 04:40:43 perky Exp $ + * $Id: _euc_jisx0213.c,v 1.4 2003/07/08 04:58:35 perky Exp $ */ #define USING_BINARY_PAIR_SEARCH @@ -65,6 +65,7 @@ if ((*inbuf)[1] >> 10 == 0xdc00 >> 10) { /* low surrogate */ c = 0x10000 + ((c - 0xd800) << 10) + ((ucs4_t)((*inbuf)[1]) - 0xdc00); + insize = 2; } } #endif @@ -106,14 +107,11 @@ code = 0x2140; else return 1; - } else TRYMAP_ENC(jisx0213_emp, code, c & 0xffff) -#if Py_UNICODE_SIZE == 2 - insize = 2; - else return 2; -#else - ; - else return 1; -#endif + } else if (c >> 16 == EMPBASE >> 16) { + TRYMAP_ENC(jisx0213_emp, code, c & 0xffff); + else return insize; + } else + return insize; if (code & 0x8000) { /* Codeset 2 */ |