koco-cvs Mailing List for Python Korean Codecs (Page 6)
Brought to you by:
perky
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(88) |
May
(5) |
Jun
|
Jul
(27) |
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(77) |
Feb
(3) |
Mar
|
Apr
(22) |
May
(123) |
Jun
(80) |
Jul
(83) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Hye-Shik C. <pe...@us...> - 2003-06-10 11:12:15
|
perky 03/06/10 04:12:13 Modified: tools genmap_japanese.py genmap_schinese.py genmap_tchinese.py genmap_korean.py genmap_support.py Log: Remove old datever values. Revision Changes Path 1.7 +5 -5 cjkcodecs/tools/genmap_japanese.py Index: genmap_japanese.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tools/genmap_japanese.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- genmap_japanese.py 26 May 2003 13:51:19 -0000 1.6 +++ genmap_japanese.py 10 Jun 2003 11:12:12 -0000 1.7 @@ -26,7 +26,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: genmap_japanese.py,v 1.6 2003/05/26 13:51:19 perky Exp $ +# $Id: genmap_japanese.py,v 1.7 2003/06/10 11:12:12 perky Exp $ # from genmap_support import * @@ -62,10 +62,10 @@ raise SystemExit print "Loading Mapping File..." -jisx0208datever, sjisdecmap = loadmap(jisx0208file, natcol=0, unicol=2) -jisx0208datever, jisx0208decmap = loadmap(jisx0208file, natcol=1, unicol=2) -jisx0212datever, jisx0212decmap = loadmap(jisx0212file) -cp932datever, cp932decmap = loadmap(cp932file) +sjisdecmap = loadmap(jisx0208file, natcol=0, unicol=2) +jisx0208decmap = loadmap(jisx0208file, natcol=1, unicol=2) +jisx0212decmap = loadmap(jisx0212file) +cp932decmap = loadmap(cp932file) sjisencmap, cp932encmap = {}, {} jisx0208_0212encmap = {} 1.2 +3 -3 cjkcodecs/tools/genmap_schinese.py Index: genmap_schinese.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tools/genmap_schinese.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- genmap_schinese.py 17 May 2003 20:33:06 -0000 1.1 +++ genmap_schinese.py 10 Jun 2003 11:12:12 -0000 1.2 @@ -26,7 +26,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: genmap_schinese.py,v 1.1 2003/05/17 20:33:06 perky Exp $ +# $Id: genmap_schinese.py,v 1.2 2003/06/10 11:12:12 perky Exp $ # from genmap_support import * @@ -88,8 +88,8 @@ print "Loading Mapping File..." gb18030decmap, gb18030unilinear = parse_gb18030map(gb18030map) -datever, gbkdecmap = loadmap(cp936map) -gb2312_datever, gb2312decmap = loadmap(gb2312map) +gbkdecmap = loadmap(cp936map) +gb2312decmap = loadmap(gb2312map) difmap = {} for c1, m in gbkdecmap.items(): for c2, code in m.items(): 1.3 +3 -3 cjkcodecs/tools/genmap_tchinese.py Index: genmap_tchinese.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tools/genmap_tchinese.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- genmap_tchinese.py 28 May 2003 06:51:33 -0000 1.2 +++ genmap_tchinese.py 10 Jun 2003 11:12:12 -0000 1.3 @@ -26,7 +26,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: genmap_tchinese.py,v 1.2 2003/05/28 06:51:33 perky Exp $ +# $Id: genmap_tchinese.py,v 1.3 2003/06/10 11:12:12 perky Exp $ # from genmap_support import * @@ -52,8 +52,8 @@ raise SystemExit print "Loading Mapping File..." -datever, cp950decmap = loadmap(cp950map) -big5_datever, big5decmap = loadmap(big5map) +cp950decmap = loadmap(cp950map) +big5decmap = loadmap(big5map) big5encmap, cp950encmap = {}, {} for c1, m in cp950decmap.items(): for c2, code in m.items(): 1.6 +2 -2 cjkcodecs/tools/genmap_korean.py Index: genmap_korean.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tools/genmap_korean.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- genmap_korean.py 27 May 2003 04:31:00 -0000 1.5 +++ genmap_korean.py 10 Jun 2003 11:12:12 -0000 1.6 @@ -26,7 +26,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: genmap_korean.py,v 1.5 2003/05/27 04:31:00 perky Exp $ +# $Id: genmap_korean.py,v 1.6 2003/06/10 11:12:12 perky Exp $ # from genmap_support import * @@ -46,7 +46,7 @@ raise SystemExit print "Loading Mapping File..." -datever, decmap = loadmap(mapfile) +decmap = loadmap(mapfile) uhcdecmap, ksx1001decmap = {}, {} cp949encmap = {} for c1, c2map in decmap.iteritems(): 1.7 +3 -9 cjkcodecs/tools/genmap_support.py Index: genmap_support.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tools/genmap_support.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- genmap_support.py 2 Jun 2003 11:21:06 -0000 1.6 +++ genmap_support.py 10 Jun 2003 11:12:12 -0000 1.7 @@ -26,18 +26,16 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: genmap_support.py,v 1.6 2003/06/02 11:21:06 perky Exp $ +# $Id: genmap_support.py,v 1.7 2003/06/10 11:12:12 perky Exp $ # import re COPYRIGHT_HEADER = """\ /* - * $Id: genmap_support.py,v 1.6 2003/06/02 11:21:06 perky Exp $ + * $Id: genmap_support.py,v 1.7 2003/06/10 11:12:12 perky Exp $ */ """ -re_UNIMAPDATE = re.compile('Date:\s*([ a-zA-Z0-9/]*)') -re_UNIMAPVERSION= re.compile('Table version:\s*([0-9.]+)') def printcopyright(fo): print >> fo, COPYRIGHT_HEADER @@ -145,10 +143,6 @@ def loadmap(fo, natcol=0, unicol=1, sbcs=0): fo.seek(0, 0) head = fo.read(1024) - mapdatever = '%s-%s' % ( - re_UNIMAPVERSION.findall(head)[0], - re_UNIMAPDATE.findall(head)[0] - ) fo.seek(0, 0) decmap = {} @@ -162,6 +156,6 @@ decmap.setdefault((loc >> 8), {}) decmap[(loc >> 8)][(loc & 0xff)] = uni - return mapdatever, decmap + return decmap # ex: ts=8 sts=4 et |
From: Hye-Shik C. <pe...@us...> - 2003-06-10 07:03:07
|
perky 03/06/10 00:03:07 Modified: . setup.py Log: Refactor a code Revision Changes Path 1.21 +2 -2 cjkcodecs/setup.py Index: setup.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/setup.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- setup.py 5 Jun 2003 09:57:07 -0000 1.20 +++ setup.py 10 Jun 2003 07:03:06 -0000 1.21 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: setup.py,v 1.20 2003/06/05 09:57:07 perky Exp $ +# $Id: setup.py,v 1.21 2003/06/10 07:03:06 perky Exp $ # import sys @@ -42,7 +42,7 @@ 'zh_TW': ['big5', 'cp950'], '': ['utf_8'], } -locales = ['ja_JP', 'ko_KR', 'zh_CN', 'zh_TW', ''] +locales = encodings.keys() for arg in sys.argv[1:]: # don't use getopt to ignore arguments for distutils args = arg.split('=', 1) |
From: Hye-Shik C. <pe...@us...> - 2003-06-10 06:17:02
|
perky 03/06/09 23:17:00 Modified: tests/sampletexts big5.txt big5.utf8 Log: s/CRLF/LF/g Revision Changes Path 1.2 +8 -8 cjkcodecs/tests/sampletexts/big5.txt <<Binary file>> 1.2 +8 -8 cjkcodecs/tests/sampletexts/big5.utf8 <<Binary file>> |
From: Hye-Shik C. <pe...@us...> - 2003-06-09 10:25:39
|
perky 03/06/09 03:25:37 Modified: src _big5.c _cp932.c _cp949.c _cp950.c _euc_kr.c _gb18030.c _gb2312.c _gbk.c Log: Reduce useless intermediate buffers. Revision Changes Path 1.6 +4 -7 cjkcodecs/src/_big5.c Index: _big5.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_big5.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- _big5.c 31 May 2003 11:50:18 -0000 1.5 +++ _big5.c 9 Jun 2003 10:25:36 -0000 1.6 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: _big5.c,v 1.5 2003/05/31 11:50:18 perky Exp $ + * $Id: _big5.c,v 1.6 2003/06/09 10:25:36 perky Exp $ */ #include "codeccommon.h" @@ -65,7 +65,6 @@ { while (inleft > 0) { unsigned char c = **inbuf; - Py_UNICODE code; RESERVE_OUTBUF(1) @@ -76,11 +75,9 @@ } RESERVE_INBUF(2) - TRYMAP_DEC(big5, code, c, (*inbuf)[1]); - else return 2; - - **outbuf = code; - NEXT(2, 1) + TRYMAP_DEC(big5, **outbuf, c, (*inbuf)[1]) { + NEXT(2, 1) + } else return 2; } return 0; 1.3 +4 -6 cjkcodecs/src/_cp932.c Index: _cp932.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_cp932.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- _cp932.c 31 May 2003 11:50:19 -0000 1.2 +++ _cp932.c 9 Jun 2003 10:25:36 -0000 1.3 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: _cp932.c,v 1.2 2003/05/31 11:50:19 perky Exp $ + * $Id: _cp932.c,v 1.3 2003/06/09 10:25:36 perky Exp $ */ #include "codeccommon.h" @@ -91,7 +91,6 @@ { while (inleft > 0) { unsigned char c = **inbuf, c2; - Py_UNICODE code; RESERVE_OUTBUF(1) if (c < 0x80) { @@ -103,7 +102,7 @@ RESERVE_INBUF(2) c2 = (*inbuf)[1]; - TRYMAP_DEC(cp932ext, code, c, c2); + TRYMAP_DEC(cp932ext, **outbuf, c, c2); else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)) { if (c2 < 0x40 || (c2 > 0x7e && c2 < 0x80) || c2 > 0xfc) return 2; @@ -113,18 +112,17 @@ c = (2 * c + (c2 < 0x5e ? 0 : 1) + 0x21); c2 = (c2 < 0x5e ? c2 : c2 - 0x5e) + 0x21; - TRYMAP_DEC(jisx0208, code, c, c2); + TRYMAP_DEC(jisx0208, **outbuf, c, c2); else return 2; } else if (c >= 0xf0 && c <= 0xf9) { if ((c2 >= 0x40 && c2 <= 0x7e) || (c2 >= 0x80 && c2 <= 0xfc)) - code = 0xe000 + 188 * (c - 0xf0) + + **outbuf = 0xe000 + 188 * (c - 0xf0) + (c2 < 0x80 ? c2 - 0x40 : c2 - 0x41); else return 2; } else return 2; - **outbuf = code; NEXT(2, 1) } 1.10 +3 -5 cjkcodecs/src/_cp949.c Index: _cp949.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_cp949.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- _cp949.c 31 May 2003 11:50:19 -0000 1.9 +++ _cp949.c 9 Jun 2003 10:25:36 -0000 1.10 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: _cp949.c,v 1.9 2003/05/31 11:50:19 perky Exp $ + * $Id: _cp949.c,v 1.10 2003/06/09 10:25:36 perky Exp $ */ #include "codeccommon.h" @@ -68,7 +68,6 @@ { while (inleft > 0) { unsigned char c = **inbuf; - Py_UNICODE code; RESERVE_OUTBUF(1) @@ -79,11 +78,10 @@ } RESERVE_INBUF(2) - TRYMAP_DEC(ksx1001, code, c ^ 0x80, (*inbuf)[1] ^ 0x80); - else TRYMAP_DEC(cp949ext, code, c, (*inbuf)[1]); + TRYMAP_DEC(ksx1001, **outbuf, c ^ 0x80, (*inbuf)[1] ^ 0x80); + else TRYMAP_DEC(cp949ext, **outbuf, c, (*inbuf)[1]); else return 2; - **outbuf = code; NEXT(2, 1) } 1.6 +3 -5 cjkcodecs/src/_cp950.c Index: _cp950.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_cp950.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- _cp950.c 31 May 2003 11:50:19 -0000 1.5 +++ _cp950.c 9 Jun 2003 10:25:36 -0000 1.6 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: _cp950.c,v 1.5 2003/05/31 11:50:19 perky Exp $ + * $Id: _cp950.c,v 1.6 2003/06/09 10:25:36 perky Exp $ */ #include "codeccommon.h" @@ -67,7 +67,6 @@ { while (inleft > 0) { unsigned char c = **inbuf; - Py_UNICODE code; RESERVE_OUTBUF(1) @@ -79,11 +78,10 @@ RESERVE_INBUF(2) - TRYMAP_DEC(cp950ext, code, c, (*inbuf)[1]); - else TRYMAP_DEC(big5, code, c, (*inbuf)[1]); + TRYMAP_DEC(cp950ext, **outbuf, c, (*inbuf)[1]); + else TRYMAP_DEC(big5, **outbuf, c, (*inbuf)[1]); else return 2; - **outbuf = code; NEXT(2, 1) } 1.13 +4 -6 cjkcodecs/src/_euc_kr.c Index: _euc_kr.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_euc_kr.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- _euc_kr.c 31 May 2003 11:50:19 -0000 1.12 +++ _euc_kr.c 9 Jun 2003 10:25:36 -0000 1.13 @@ -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_kr.c,v 1.12 2003/05/31 11:50:19 perky Exp $ + * $Id: _euc_kr.c,v 1.13 2003/06/09 10:25:36 perky Exp $ */ #include "codeccommon.h" @@ -67,7 +67,6 @@ { while (inleft > 0) { unsigned char c = **inbuf; - Py_UNICODE code; RESERVE_OUTBUF(1) @@ -79,11 +78,10 @@ RESERVE_INBUF(2) - TRYMAP_DEC(ksx1001, code, c ^ 0x80, (*inbuf)[1] ^ 0x80); - else return 2; + TRYMAP_DEC(ksx1001, **outbuf, c ^ 0x80, (*inbuf)[1] ^ 0x80) { + NEXT(2, 1) + } else return 2; - **outbuf = code; - NEXT(2, 1) } return 0; 1.7 +5 -7 cjkcodecs/src/_gb18030.c Index: _gb18030.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_gb18030.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- _gb18030.c 31 May 2003 11:50:19 -0000 1.6 +++ _gb18030.c 9 Jun 2003 10:25:36 -0000 1.7 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: _gb18030.c,v 1.6 2003/05/31 11:50:19 perky Exp $ + * $Id: _gb18030.c,v 1.7 2003/06/09 10:25:36 perky Exp $ */ #include "codeccommon.h" @@ -126,7 +126,6 @@ { while (inleft > 0) { unsigned char c = **inbuf, c2; - Py_UNICODE code; RESERVE_OUTBUF(1) @@ -178,13 +177,12 @@ return 4; } - GBK_PREDECODE(c, c2, code) - else TRYMAP_DEC(gb2312, code, c ^ 0x80, c2 ^ 0x80); - else TRYMAP_DEC(gbkext, code, c, c2); - else TRYMAP_DEC(gb18030ext, code, c, c2); + GBK_PREDECODE(c, c2, **outbuf) + else TRYMAP_DEC(gb2312, **outbuf, c ^ 0x80, c2 ^ 0x80); + else TRYMAP_DEC(gbkext, **outbuf, c, c2); + else TRYMAP_DEC(gb18030ext, **outbuf, c, c2); else return 2; - **outbuf = code; NEXT(2, 1) } 1.8 +4 -7 cjkcodecs/src/_gb2312.c Index: _gb2312.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_gb2312.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- _gb2312.c 31 May 2003 11:50:19 -0000 1.7 +++ _gb2312.c 9 Jun 2003 10:25:36 -0000 1.8 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: _gb2312.c,v 1.7 2003/05/31 11:50:19 perky Exp $ + * $Id: _gb2312.c,v 1.8 2003/06/09 10:25:36 perky Exp $ */ #include "codeccommon.h" @@ -67,7 +67,6 @@ { while (inleft > 0) { unsigned char c = **inbuf; - Py_UNICODE code; RESERVE_OUTBUF(1) @@ -78,11 +77,9 @@ } RESERVE_INBUF(2) - TRYMAP_DEC(gb2312, code, c ^ 0x80, (*inbuf)[1] ^ 0x80); - else return 2; - - **outbuf = code; - NEXT(2, 1) + TRYMAP_DEC(gb2312, **outbuf, c ^ 0x80, (*inbuf)[1] ^ 0x80) { + NEXT(2, 1) + } else return 2; } return 0; 1.7 +4 -6 cjkcodecs/src/_gbk.c Index: _gbk.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_gbk.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- _gbk.c 31 May 2003 11:50:19 -0000 1.6 +++ _gbk.c 9 Jun 2003 10:25:36 -0000 1.7 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: _gbk.c,v 1.6 2003/05/31 11:50:19 perky Exp $ + * $Id: _gbk.c,v 1.7 2003/06/09 10:25:36 perky Exp $ */ #include "codeccommon.h" @@ -71,7 +71,6 @@ { while (inleft > 0) { unsigned char c = **inbuf; - Py_UNICODE code; RESERVE_OUTBUF(1) @@ -83,12 +82,11 @@ RESERVE_INBUF(2) - GBK_PREDECODE(c, (*inbuf)[1], code) - else TRYMAP_DEC(gb2312, code, c ^ 0x80, (*inbuf)[1] ^ 0x80); - else TRYMAP_DEC(gbkext, code, c, (*inbuf)[1]); + GBK_PREDECODE(c, (*inbuf)[1], **outbuf) + else TRYMAP_DEC(gb2312, **outbuf, c ^ 0x80, (*inbuf)[1] ^ 0x80); + else TRYMAP_DEC(gbkext, **outbuf, c, (*inbuf)[1]); else return 2; - **outbuf = code; NEXT(2, 1) } |
From: Hye-Shik C. <pe...@us...> - 2003-06-06 07:01:16
|
perky 03/06/06 00:01:16 Modified: . MANIFEST.in Log: Add downloadall.sh to distribution Revision Changes Path 1.2 +2 -2 cjkcodecs/MANIFEST.in Index: MANIFEST.in =================================================================== RCS file: /cvsroot/koco/cjkcodecs/MANIFEST.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MANIFEST.in 6 Jun 2003 06:42:44 -0000 1.1 +++ MANIFEST.in 6 Jun 2003 07:01:14 -0000 1.2 @@ -1,10 +1,10 @@ -# $Id: MANIFEST.in,v 1.1 2003/06/06 06:42:44 perky Exp $ +# $Id: MANIFEST.in,v 1.2 2003/06/06 07:01:14 perky Exp $ include README ROADMAP AUTHORS COPYRIGHT include MANIFEST.in recursive-include src *.h *.c -recursive-include tests *.py *.txt *.utf8 +recursive-include tests *.py *.txt *.utf8 *.sh recursive-include tools *.py global-exclude */CVS/* *.pyc *.pyo |
From: Hye-Shik C. <pe...@us...> - 2003-06-06 06:56:03
|
perky 03/06/05 23:56:02 Modified: src multibytecodec.c Log: Use 0 instead of NULL for integer variables. Revision Changes Path 1.17 +2 -2 cjkcodecs/src/multibytecodec.c Index: multibytecodec.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/multibytecodec.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- multibytecodec.c 6 Jun 2003 06:27:41 -0000 1.16 +++ multibytecodec.c 6 Jun 2003 06:56:01 -0000 1.17 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: multibytecodec.c,v 1.16 2003/06/06 06:27:41 perky Exp $ + * $Id: multibytecodec.c,v 1.17 2003/06/06 06:56:01 perky Exp $ */ #include "Python.h" @@ -1049,7 +1049,7 @@ unsigned char *rsbuf_top, *rsbuf_cur; rsbufnc = 0; - for (rsbufsiz = NULL;;rsbufsiz *= 2) { + for (rsbufsiz = 0;;rsbufsiz *= 2) { if (rsbuf == NULL) { rsbuf = PyString_FromStringAndSize(NULL, rsbufsiz); if (rsbuf == NULL) |
From: Hye-Shik C. <pe...@us...> - 2003-06-06 06:42:46
|
perky 03/06/05 23:42:45 Added: . MANIFEST.in README Log: Add distribution files Revision Changes Path 1.1 cjkcodecs/MANIFEST.in Index: MANIFEST.in =================================================================== # $Id: MANIFEST.in,v 1.1 2003/06/06 06:42:44 perky Exp $ include README ROADMAP AUTHORS COPYRIGHT include MANIFEST.in recursive-include src *.h *.c recursive-include tests *.py *.txt *.utf8 recursive-include tools *.py global-exclude */CVS/* *.pyc *.pyo 1.1 cjkcodecs/README Index: README =================================================================== CJK Codecs 0.9 ============== Copyright(C) 2002-2003 Hye-Shik Chang. $Id: README,v 1.1 2003/06/06 06:42:44 perky Exp $ Introduction ------------ This package provides Unicode codecs that make Python aware of CJK (Chinese, Japanese and Korean) encodings such as EUC-JP, ISO-2022-KR, BIG5 and GB18030. By using this package, their characters can be treated as a character string instead of a byte sequence. The Unicode-related API in Python was proposed by Marc-Andre Lemburg and defined in the following specification: http://starship.python.net/crew/lemburg/unicode-proposal.txt The provided codecs follow the proposal version 1.8. Please consult the specification for the details of the codecs. The latest version of this package is available at: http://sourceforge.net/projects/koco/ Requirement ----------- This package requires Python 2.1 or later. This package can be easily installed by means of the Distutils (Python Distribution Utilities). Simply issue the following command, after being root if necessary: python setup.py install If you don't need full supports for all the encodings, you can specify the following options: --disable-japanese don't install Japanese codecs --disable-korean don't install Korean codecs --disable-simplified-chinese don't install Simplified Chinese codecs --disable-traditional-chinese don't install Traditional Chinese codecs Author ------ Hye-Shik Chang <pe...@Fr...> Any comments, suggestions, and/or patches are very welcome. Thank you for using CJK Codecs! |
From: Hye-Shik C. <pe...@us...> - 2003-06-06 06:27:42
|
perky 03/06/05 23:27:42 Modified: src codeccommon.h multibytecodec.c multibytecodec_compat.h Log: Get python2.1 compatibility Revision Changes Path 1.12 +2 -1 cjkcodecs/src/codeccommon.h Index: codeccommon.h =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/codeccommon.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- codeccommon.h 2 Jun 2003 09:24:50 -0000 1.11 +++ codeccommon.h 6 Jun 2003 06:27:41 -0000 1.12 @@ -26,11 +26,12 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: codeccommon.h,v 1.11 2003/06/02 09:24:50 perky Exp $ + * $Id: codeccommon.h,v 1.12 2003/06/06 06:27:41 perky Exp $ */ #include "Python.h" #include "multibytecodec.h" +#include "multibytecodec_compat.h" #include "cjkcommon.h" #define ENCMAP(encoding) \ 1.16 +34 -7 cjkcodecs/src/multibytecodec.c Index: multibytecodec.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/multibytecodec.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- multibytecodec.c 6 Jun 2003 05:57:53 -0000 1.15 +++ multibytecodec.c 6 Jun 2003 06:27:41 -0000 1.16 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: multibytecodec.c,v 1.15 2003/06/06 05:57:53 perky Exp $ + * $Id: multibytecodec.c,v 1.16 2003/06/06 06:27:41 perky Exp $ */ #include "Python.h" @@ -659,6 +659,8 @@ PyObject_Del(self); } +OLD_GETATTR_DEF(multibytecodec) + static PyTypeObject MultibyteCodec_Type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ @@ -668,7 +670,7 @@ /* methods */ (destructor)multibytecodec_dealloc, /* tp_dealloc */ 0, /* tp_print */ - 0, /* tp_getattr */ + GETATTR_FUNC(multibytecodec), /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ @@ -678,11 +680,12 @@ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ + GETATTRO_FUNC(multibytecodec), /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ 0, /* tp_doc */ +#ifndef OLD_STYLE_TYPE 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -690,6 +693,7 @@ 0, /* tp_iter */ 0, /* tp_iterext */ multibytecodec_methods, /* tp_methods */ +#endif }; static PyObject * @@ -917,6 +921,8 @@ PyObject_Del(self); } +OLD_GETATTR_DEF(mbstreamreader) + static PyTypeObject MultibyteStreamReader_Type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ @@ -926,7 +932,7 @@ /* methods */ (destructor)mbstreamreader_dealloc, /* tp_dealloc */ 0, /* tp_print */ - 0, /* tp_getattr */ + GETATTR_FUNC(mbstreamreader), /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ @@ -936,11 +942,12 @@ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ + GETATTRO_FUNC(mbstreamreader), /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ 0, /* tp_doc */ +#ifndef OLD_STYLE_TYPE 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -948,6 +955,7 @@ 0, /* tp_iter */ 0, /* tp_iterext */ mbstreamreader_methods, /* tp_methods */ +#endif }; static int @@ -1101,6 +1109,8 @@ {NULL, NULL}, }; +OLD_GETATTR_DEF(mbstreamwriter) + static PyTypeObject MultibyteStreamWriter_Type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ @@ -1110,7 +1120,7 @@ /* methods */ (destructor)mbstreamwriter_dealloc, /* tp_dealloc */ 0, /* tp_print */ - 0, /* tp_getattr */ + GETATTR_FUNC(mbstreamwriter), /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ @@ -1120,11 +1130,12 @@ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ + GETATTRO_FUNC(mbstreamwriter), /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ 0, /* tp_doc */ +#ifndef OLD_STYLE_TYPE 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -1132,13 +1143,25 @@ 0, /* tp_iter */ 0, /* tp_iterext */ mbstreamwriter_methods, /* tp_methods */ +#endif }; static PyObject * +#ifndef NO_METH_O __create_codec(PyObject *ignore, PyObject *arg) +#else +__create_codec(PyObject *ignore, PyObject *args) +#endif { MultibyteCodecObject *self; +#ifdef NO_METH_O + PyObject *arg; + + if (!PyArg_ParseTuple(args, "O:__create_codec", &arg)) + return NULL; +#endif + if (!PyCObject_Check(arg)) { PyErr_SetString(PyExc_ValueError, "argument type invalid"); return NULL; @@ -1209,7 +1232,11 @@ } static struct PyMethodDef __methods[] = { +#ifndef NO_METH_O {"__create_codec", (PyCFunction)__create_codec, METH_O}, +#else + {"__create_codec", (PyCFunction)__create_codec, METH_VARARGS}, +#endif {NULL, NULL}, }; 1.2 +15 -3 cjkcodecs/src/multibytecodec_compat.h Index: multibytecodec_compat.h =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/multibytecodec_compat.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- multibytecodec_compat.h 6 Jun 2003 05:57:53 -0000 1.1 +++ multibytecodec_compat.h 6 Jun 2003 06:27:42 -0000 1.2 @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: multibytecodec_compat.h,v 1.1 2003/06/06 05:57:53 perky Exp $ + * $Id: multibytecodec_compat.h,v 1.2 2003/06/06 06:27:42 perky Exp $ */ /* We don't support 2.0 and older */ @@ -48,9 +48,21 @@ #if PY_VERSION_HEX < 0x02020000 # define Py_USING_UNICODE 1 # define Py_UNICODE_SIZE 2 -# define NO_PYSTRING_FROMFORMAT 1 -# define OLD_STYLE_TYPE 1 # define METH_NOARGS METH_VARARGS +# define NO_METH_O 1 +# define OLD_STYLE_TYPE 1 +# define OLD_GETATTR_DEF(prefix) \ + static PyObject * \ + prefix##_getattr(PyObject *self, char *name) \ + { \ + return Py_FindMethod(prefix##_methods, self, name); \ + } +# define GETATTR_FUNC(prefix) prefix##_getattr +# define GETATTRO_FUNC(prefix) 0 +#else +# define OLD_GETATTR_DEF(prefix) +# define GETATTR_FUNC(prefix) 0 +# define GETATTRO_FUNC(prefix) PyObject_GenericGetAttr #endif /* |
From: Hye-Shik C. <pe...@us...> - 2003-06-06 06:27:00
|
perky 03/06/05 23:26:59 Modified: src _utf_8.c Log: Fix typos Revision Changes Path 1.5 +4 -4 cjkcodecs/src/_utf_8.c Index: _utf_8.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_utf_8.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- _utf_8.c 6 Jun 2003 05:52:03 -0000 1.4 +++ _utf_8.c 6 Jun 2003 06:26:59 -0000 1.5 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: _utf_8.c,v 1.4 2003/06/06 05:52:03 perky Exp $ + * $Id: _utf_8.c,v 1.5 2003/06/06 06:26:59 perky Exp $ */ #include "codeccommon.h" @@ -127,7 +127,7 @@ #else unsigned char c2, c3, c4; - RESERVER_INBUF(4) + RESERVE_INBUF(4) c2 = (*inbuf)[1]; c3 = (*inbuf)[2]; c4 = (*inbuf)[3]; if (!((c2 ^ 0x80) < 0x40 && @@ -146,7 +146,7 @@ #else unsigned char c2, c3, c4, c5; - RESERVER_INBUF(5) + RESERVE_INBUF(5) c2 = (*inbuf)[1]; c3 = (*inbuf)[2]; c4 = (*inbuf)[3]; c5 = (*inbuf)[4]; if (!((c2 ^ 0x80) < 0x40 && @@ -166,7 +166,7 @@ #else unsigned char c2, c3, c4, c5, c6; - RESERVER_INBUF(6) + RESERVE_INBUF(6) c2 = (*inbuf)[1]; c3 = (*inbuf)[2]; c4 = (*inbuf)[3]; c5 = (*inbuf)[4]; c6 = (*inbuf)[5]; |
From: Hye-Shik C. <pe...@us...> - 2003-06-06 06:23:06
|
perky 03/06/05 23:23:05 Modified: src _johab.c Log: Reduce warning Revision Changes Path 1.5 +2 -2 cjkcodecs/src/_johab.c Index: _johab.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_johab.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- _johab.c 31 May 2003 11:50:19 -0000 1.4 +++ _johab.c 6 Jun 2003 06:23:05 -0000 1.5 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: _johab.c,v 1.4 2003/05/31 11:50:19 perky Exp $ + * $Id: _johab.c,v 1.5 2003/06/06 06:23:05 perky Exp $ */ #include "codeccommon.h" @@ -89,7 +89,7 @@ unsigned char c1, c2, t2; unsigned short t1; - assert(code & 0x8000 == 0); + assert((code & 0x8000) == 0); c1 = code >> 8; c2 = code & 0xff; if (((c1 >= 0x21 && c1 <= 0x2c) || (c1 >= 0x4a && c1 <= 0x7d)) |
From: Hye-Shik C. <pe...@us...> - 2003-06-06 05:57:55
|
perky 03/06/05 22:57:54 Modified: src multibytecodec.c Added: src multibytecodec_compat.h Log: Add Python-2.2 compatibility Revision Changes Path 1.15 +44 -4 cjkcodecs/src/multibytecodec.c Index: multibytecodec.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/multibytecodec.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- multibytecodec.c 5 Jun 2003 09:56:22 -0000 1.14 +++ multibytecodec.c 6 Jun 2003 05:57:53 -0000 1.15 @@ -26,11 +26,12 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: multibytecodec.c,v 1.14 2003/06/05 09:56:22 perky Exp $ + * $Id: multibytecodec.c,v 1.15 2003/06/06 05:57:53 perky Exp $ */ #include "Python.h" #include "multibytecodec.h" +#include "multibytecodec_compat.h" typedef struct { const Py_UNICODE *inbuf, *inbuf_top, *inbuf_end; @@ -113,8 +114,15 @@ return ERROR_IGNORE; else if (strcmp(errors, "replace") == 0) return ERROR_REPLACE; - else + else { +#ifndef NO_ERROR_CALLBACKS return PyCodec_LookupError(errors); +#else + PyErr_Format(PyExc_LookupError, "unknown error handler name '%s'", + errors); + return NULL; +#endif + } } static int @@ -169,10 +177,13 @@ MultibyteEncodeBuffer *buf, PyObject *errors, int e) { +#ifndef NO_ERROR_CALLBACKS PyObject *retobj = NULL, *retstr = NULL, *argsobj, *tobj; + int retstrsize, newpos; +#endif const char *reason; size_t esize; - int retstrsize, newpos, start, end; + int start, end; if (e > 0) { reason = "illegal multibyte sequence"; @@ -224,6 +235,18 @@ start = (int)(buf->inbuf - buf->inbuf_top); end = start + esize; +#ifdef NO_ERROR_CALLBACKS + if (esize == 1) + PyErr_Format(PyExc_UnicodeError, + "'%s' codec can't encode byte '\\u%04x' in position %d: %s", + codec->encoding, *buf->inbuf, start, reason); + else + PyErr_Format(PyExc_UnicodeError, + "'%s' codec can't encode bytes in position %d-%d: %s", + codec->encoding, start, end, reason); +errorexit: + return -1; +#else /* use cached exception object if available */ if (buf->excobj == NULL) { buf->excobj = PyUnicodeEncodeError_Create(codec->encoding, @@ -290,6 +313,7 @@ Py_XDECREF(retobj); Py_XDECREF(retstr); return -1; +#endif } static int @@ -298,10 +322,13 @@ MultibyteDecodeBuffer *buf, PyObject *errors, int e) { +#ifndef NO_ERROR_CALLBACKS PyObject *argsobj, *retobj = NULL, *retuni = NULL; + int retunisize, newpos; +#endif const char *reason; size_t esize; - int start, end, retunisize, newpos; + int start, end; if (e > 0) { reason = "illegal multibyte sequence"; @@ -336,6 +363,18 @@ start = (int)(buf->inbuf - buf->inbuf_top); end = start + esize; +#ifdef NO_ERROR_CALLBACKS + if (esize == 1) + PyErr_Format(PyExc_UnicodeError, + "'%s' codec can't decode byte 0x%02x in position %d: %s", + codec->encoding, *buf->inbuf, start, reason); + else + PyErr_Format(PyExc_UnicodeError, + "'%s' codec can't decode bytes in position %d-%d: %s", + codec->encoding, start, end, reason); +errorexit: + return -1; +#else /* use cached exception object if available */ if (buf->excobj == NULL) { buf->excobj = PyUnicodeDecodeError_Create(codec->encoding, @@ -396,6 +435,7 @@ errorexit: Py_XDECREF(retobj); return -1; +#endif } static PyObject * 1.1 cjkcodecs/src/multibytecodec_compat.h Index: multibytecodec_compat.h =================================================================== /* * multibytecodec_compat.h: Compatiblility Support * * Copyright (C) 2003 Hye-Shik Chang. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id: multibytecodec_compat.h,v 1.1 2003/06/06 05:57:53 perky Exp $ */ /* We don't support 2.0 and older */ #if PY_VERSION_HEX < 0x02010000 # error "multibytecodec requires python 2.1 or compatible" #endif /* PyDoc_VAR: For ~ Python 2.2 */ #if PY_VERSION_HEX < 0x02030000 # define PyDoc_VAR(name) static char name[] # define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str) # define PyDoc_STR(str) str #endif /* PEP293 Codec Error Callbacks are only for Python 2.3 and over */ #if PY_VERSION_HEX < 0x02030000 # define NO_ERROR_CALLBACKS 1 #endif /* Python 2.1 doesn't have sth */ #if PY_VERSION_HEX < 0x02020000 # define Py_USING_UNICODE 1 # define Py_UNICODE_SIZE 2 # define NO_PYSTRING_FROMFORMAT 1 # define OLD_STYLE_TYPE 1 # define METH_NOARGS METH_VARARGS #endif /* * ex: ts=8 sts=4 et */ |
From: Hye-Shik C. <pe...@us...> - 2003-06-06 05:55:33
|
perky 03/06/05 22:55:32 Modified: tests test_encoding_big5.py test_encoding_cp932.py test_encoding_cp949.py test_encoding_euc_jp.py test_encoding_euc_kr.py test_encoding_gb18030.py test_encoding_gb2312.py test_encoding_gbk.py test_encoding_johab.py test_encoding_shift_jis.py test_mapping_cp932.py test_mapping_cp949.py test_mapping_cp950.py test_mapping_euc_jp.py test_mapping_euc_kr.py test_mapping_gb2312.py test_mapping_gbk.py test_mapping_johab.py test_mapping_shift_jis.py Log: Specify more detailed encoding name for ours (cjkcodecs.blah) Revision Changes Path 1.2 +2 -2 cjkcodecs/tests/test_encoding_big5.py Index: test_encoding_big5.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_encoding_big5.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_encoding_big5.py 28 May 2003 07:01:35 -0000 1.1 +++ test_encoding_big5.py 6 Jun 2003 05:55:30 -0000 1.2 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_encoding_big5.py,v 1.1 2003/05/28 07:01:35 perky Exp $ +# $Id: test_encoding_big5.py,v 1.2 2003/06/06 05:55:30 perky Exp $ # from test import test_support @@ -35,7 +35,7 @@ import unittest class Test_Big5(test_multibytecodec_support.TestBase, unittest.TestCase): - encoding = 'big5' + encoding = 'cjkcodecs.big5' tstring = test_multibytecodec_support.load_teststring('big5') errortests = ( # invalid bytes 1.4 +2 -2 cjkcodecs/tests/test_encoding_cp932.py Index: test_encoding_cp932.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_encoding_cp932.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- test_encoding_cp932.py 27 May 2003 05:17:47 -0000 1.3 +++ test_encoding_cp932.py 6 Jun 2003 05:55:30 -0000 1.4 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_encoding_cp932.py,v 1.3 2003/05/27 05:17:47 perky Exp $ +# $Id: test_encoding_cp932.py,v 1.4 2003/06/06 05:55:30 perky Exp $ # from test import test_support @@ -35,7 +35,7 @@ import unittest class Test_CP932(test_multibytecodec_support.TestBase, unittest.TestCase): - encoding = 'cp932' + encoding = 'cjkcodecs.cp932' tstring = test_multibytecodec_support.load_teststring('shift_jis') errortests = ( # invalid bytes 1.2 +2 -2 cjkcodecs/tests/test_encoding_cp949.py Index: test_encoding_cp949.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_encoding_cp949.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_encoding_cp949.py 27 May 2003 05:17:47 -0000 1.1 +++ test_encoding_cp949.py 6 Jun 2003 05:55:30 -0000 1.2 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_encoding_cp949.py,v 1.1 2003/05/27 05:17:47 perky Exp $ +# $Id: test_encoding_cp949.py,v 1.2 2003/06/06 05:55:30 perky Exp $ # from test import test_support @@ -35,7 +35,7 @@ import unittest class Test_CP949(test_multibytecodec_support.TestBase, unittest.TestCase): - encoding = 'cp949' + encoding = 'cjkcodecs.cp949' tstring = test_multibytecodec_support.load_teststring('cp949') errortests = ( # invalid bytes 1.3 +2 -2 cjkcodecs/tests/test_encoding_euc_jp.py Index: test_encoding_euc_jp.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_encoding_euc_jp.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- test_encoding_euc_jp.py 27 May 2003 05:17:47 -0000 1.2 +++ test_encoding_euc_jp.py 6 Jun 2003 05:55:31 -0000 1.3 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_encoding_euc_jp.py,v 1.2 2003/05/27 05:17:47 perky Exp $ +# $Id: test_encoding_euc_jp.py,v 1.3 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -35,7 +35,7 @@ import unittest class Test_EUC_JP(test_multibytecodec_support.TestBase, unittest.TestCase): - encoding = 'euc_jp' + encoding = 'cjkcodecs.euc_jp' tstring = test_multibytecodec_support.load_teststring('euc_jp') errortests = ( # invalid bytes 1.2 +2 -2 cjkcodecs/tests/test_encoding_euc_kr.py Index: test_encoding_euc_kr.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_encoding_euc_kr.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_encoding_euc_kr.py 27 May 2003 05:17:48 -0000 1.1 +++ test_encoding_euc_kr.py 6 Jun 2003 05:55:31 -0000 1.2 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_encoding_euc_kr.py,v 1.1 2003/05/27 05:17:48 perky Exp $ +# $Id: test_encoding_euc_kr.py,v 1.2 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -35,7 +35,7 @@ import unittest class Test_EUCKR(test_multibytecodec_support.TestBase, unittest.TestCase): - encoding = 'euc_kr' + encoding = 'cjkcodecs.euc_kr' tstring = test_multibytecodec_support.load_teststring('euc_kr') errortests = ( # invalid bytes 1.2 +2 -2 cjkcodecs/tests/test_encoding_gb18030.py Index: test_encoding_gb18030.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_encoding_gb18030.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_encoding_gb18030.py 28 May 2003 07:48:14 -0000 1.1 +++ test_encoding_gb18030.py 6 Jun 2003 05:55:31 -0000 1.2 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_encoding_gb18030.py,v 1.1 2003/05/28 07:48:14 perky Exp $ +# $Id: test_encoding_gb18030.py,v 1.2 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -35,7 +35,7 @@ import unittest class Test_GB18030(test_multibytecodec_support.TestBase, unittest.TestCase): - encoding = 'gb18030' + encoding = 'cjkcodecs.gb18030' tstring = test_multibytecodec_support.load_teststring('gb18030') errortests = ( # invalid bytes 1.2 +2 -2 cjkcodecs/tests/test_encoding_gb2312.py Index: test_encoding_gb2312.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_encoding_gb2312.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_encoding_gb2312.py 28 May 2003 07:48:15 -0000 1.1 +++ test_encoding_gb2312.py 6 Jun 2003 05:55:31 -0000 1.2 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_encoding_gb2312.py,v 1.1 2003/05/28 07:48:15 perky Exp $ +# $Id: test_encoding_gb2312.py,v 1.2 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -35,7 +35,7 @@ import unittest class Test_GB2312(test_multibytecodec_support.TestBase, unittest.TestCase): - encoding = 'gb2312' + encoding = 'cjkcodecs.gb2312' tstring = test_multibytecodec_support.load_teststring('gb2312') errortests = ( # invalid bytes 1.2 +2 -2 cjkcodecs/tests/test_encoding_gbk.py Index: test_encoding_gbk.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_encoding_gbk.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_encoding_gbk.py 28 May 2003 07:48:15 -0000 1.1 +++ test_encoding_gbk.py 6 Jun 2003 05:55:31 -0000 1.2 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_encoding_gbk.py,v 1.1 2003/05/28 07:48:15 perky Exp $ +# $Id: test_encoding_gbk.py,v 1.2 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -35,7 +35,7 @@ import unittest class Test_GBK(test_multibytecodec_support.TestBase, unittest.TestCase): - encoding = 'gbk' + encoding = 'cjkcodecs.gbk' tstring = test_multibytecodec_support.load_teststring('gbk') errortests = ( # invalid bytes 1.2 +2 -2 cjkcodecs/tests/test_encoding_johab.py Index: test_encoding_johab.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_encoding_johab.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_encoding_johab.py 29 May 2003 07:33:44 -0000 1.1 +++ test_encoding_johab.py 6 Jun 2003 05:55:31 -0000 1.2 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_encoding_johab.py,v 1.1 2003/05/29 07:33:44 perky Exp $ +# $Id: test_encoding_johab.py,v 1.2 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -35,7 +35,7 @@ import unittest class Test_JOHAB(test_multibytecodec_support.TestBase, unittest.TestCase): - encoding = 'johab' + encoding = 'cjkcodecs.johab' tstring = test_multibytecodec_support.load_teststring('johab') errortests = ( # invalid bytes 1.4 +2 -2 cjkcodecs/tests/test_encoding_shift_jis.py Index: test_encoding_shift_jis.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_encoding_shift_jis.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- test_encoding_shift_jis.py 27 May 2003 05:17:48 -0000 1.3 +++ test_encoding_shift_jis.py 6 Jun 2003 05:55:31 -0000 1.4 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_encoding_shift_jis.py,v 1.3 2003/05/27 05:17:48 perky Exp $ +# $Id: test_encoding_shift_jis.py,v 1.4 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -35,7 +35,7 @@ import unittest class Test_SJIS(test_multibytecodec_support.TestBase, unittest.TestCase): - encoding = 'shift_jis' + encoding = 'cjkcodecs.shift_jis' tstring = test_multibytecodec_support.load_teststring('shift_jis') errortests = ( # invalid bytes 1.3 +2 -2 cjkcodecs/tests/test_mapping_cp932.py Index: test_mapping_cp932.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_cp932.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- test_mapping_cp932.py 28 May 2003 08:02:06 -0000 1.2 +++ test_mapping_cp932.py 6 Jun 2003 05:55:31 -0000 1.3 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_cp932.py,v 1.2 2003/05/28 08:02:06 perky Exp $ +# $Id: test_mapping_cp932.py,v 1.3 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -41,7 +41,7 @@ class TestCP932Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): - encoding = 'cp932' + encoding = 'cjkcodecs.cp932' mapfilename = 'CP932.TXT' def test_main(): 1.3 +2 -2 cjkcodecs/tests/test_mapping_cp949.py Index: test_mapping_cp949.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_cp949.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- test_mapping_cp949.py 28 May 2003 08:02:06 -0000 1.2 +++ test_mapping_cp949.py 6 Jun 2003 05:55:31 -0000 1.3 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_cp949.py,v 1.2 2003/05/28 08:02:06 perky Exp $ +# $Id: test_mapping_cp949.py,v 1.3 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -41,7 +41,7 @@ 'org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP949.TXT') class TestCP949Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): - encoding = 'cp949' + encoding = 'cjkcodecs.cp949' mapfilename = 'CP949.TXT' def test_main(): 1.3 +2 -2 cjkcodecs/tests/test_mapping_cp950.py Index: test_mapping_cp950.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_cp950.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- test_mapping_cp950.py 28 May 2003 08:02:06 -0000 1.2 +++ test_mapping_cp950.py 6 Jun 2003 05:55:31 -0000 1.3 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_cp950.py,v 1.2 2003/05/28 08:02:06 perky Exp $ +# $Id: test_mapping_cp950.py,v 1.3 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -42,7 +42,7 @@ class TestCP950Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): - encoding = 'cp950' + encoding = 'cjkcodecs.cp950' mapfilename = 'CP950.TXT' def test_main(): 1.3 +2 -2 cjkcodecs/tests/test_mapping_euc_jp.py Index: test_mapping_euc_jp.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_euc_jp.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- test_mapping_euc_jp.py 28 May 2003 08:02:06 -0000 1.2 +++ test_mapping_euc_jp.py 6 Jun 2003 05:55:31 -0000 1.3 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_euc_jp.py,v 1.2 2003/05/28 08:02:06 perky Exp $ +# $Id: test_mapping_euc_jp.py,v 1.3 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -42,7 +42,7 @@ class TestEUCJPMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): - encoding = 'euc_jp' + encoding = 'cjkcodecs.euc_jp' mapfilename = 'EUC-JP.TXT' def test_main(): 1.3 +2 -2 cjkcodecs/tests/test_mapping_euc_kr.py Index: test_mapping_euc_kr.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_euc_kr.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- test_mapping_euc_kr.py 28 May 2003 08:02:06 -0000 1.2 +++ test_mapping_euc_kr.py 6 Jun 2003 05:55:31 -0000 1.3 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_euc_kr.py,v 1.2 2003/05/28 08:02:06 perky Exp $ +# $Id: test_mapping_euc_kr.py,v 1.3 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -42,7 +42,7 @@ class TestEUCKRMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): - encoding = 'euc_kr' + encoding = 'cjkcodecs.euc_kr' mapfilename = 'EUC-KR.TXT' def test_main(): 1.3 +2 -2 cjkcodecs/tests/test_mapping_gb2312.py Index: test_mapping_gb2312.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_gb2312.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- test_mapping_gb2312.py 28 May 2003 08:02:06 -0000 1.2 +++ test_mapping_gb2312.py 6 Jun 2003 05:55:31 -0000 1.3 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_gb2312.py,v 1.2 2003/05/28 08:02:06 perky Exp $ +# $Id: test_mapping_gb2312.py,v 1.3 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -42,7 +42,7 @@ class TestGB2312Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): - encoding = 'gb2312' + encoding = 'cjkcodecs.gb2312' mapfilename = 'EUC-CN.TXT' def test_main(): 1.3 +2 -2 cjkcodecs/tests/test_mapping_gbk.py Index: test_mapping_gbk.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_gbk.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- test_mapping_gbk.py 28 May 2003 08:02:07 -0000 1.2 +++ test_mapping_gbk.py 6 Jun 2003 05:55:31 -0000 1.3 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_gbk.py,v 1.2 2003/05/28 08:02:07 perky Exp $ +# $Id: test_mapping_gbk.py,v 1.3 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -42,7 +42,7 @@ class TestGBKMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): - encoding = 'gbk' + encoding = 'cjkcodecs.gbk' mapfilename = 'CP936.TXT' def test_main(): 1.4 +2 -2 cjkcodecs/tests/test_mapping_johab.py Index: test_mapping_johab.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_johab.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- test_mapping_johab.py 6 Jun 2003 05:26:56 -0000 1.3 +++ test_mapping_johab.py 6 Jun 2003 05:55:31 -0000 1.4 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_johab.py,v 1.3 2003/06/06 05:26:56 perky Exp $ +# $Id: test_mapping_johab.py,v 1.4 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -42,7 +42,7 @@ class TestJOHABMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): - encoding = 'johab' + encoding = 'cjkcodecs.johab' mapfilename = 'JOHAB.TXT' # KS X 1001 standard assigned 0x5c as WON SIGN. # but, in early 90s that is the only era used johab widely, 1.3 +2 -2 cjkcodecs/tests/test_mapping_shift_jis.py Index: test_mapping_shift_jis.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_shift_jis.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- test_mapping_shift_jis.py 28 May 2003 08:02:07 -0000 1.2 +++ test_mapping_shift_jis.py 6 Jun 2003 05:55:31 -0000 1.3 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_shift_jis.py,v 1.2 2003/05/28 08:02:07 perky Exp $ +# $Id: test_mapping_shift_jis.py,v 1.3 2003/06/06 05:55:31 perky Exp $ # from test import test_support @@ -42,7 +42,7 @@ class TestSJISMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): - encoding = 'shift_jis' + encoding = 'cjkcodecs.shift_jis' mapfilename = 'SHIFTJIS.TXT' def test_main(): |
From: Hye-Shik C. <pe...@us...> - 2003-06-06 05:52:05
|
perky 03/06/05 22:52:03 Modified: src _utf_8.c codecentry.h Log: Avoid warnings "importmaps is defined but not used" Revision Changes Path 1.4 +2 -1 cjkcodecs/src/_utf_8.c Index: _utf_8.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_utf_8.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- _utf_8.c 31 May 2003 11:50:19 -0000 1.3 +++ _utf_8.c 6 Jun 2003 05:52:03 -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: _utf_8.c,v 1.3 2003/05/31 11:50:19 perky Exp $ + * $Id: _utf_8.c,v 1.4 2003/06/06 05:52:03 perky Exp $ */ #include "codeccommon.h" @@ -190,6 +190,7 @@ return 0; } +#define CODEC_WITHOUT_MAPS #include "codecentry.h" BEGIN_CODEC_REGISTRY(utf_8) /* no maps */ 1.2 +3 -2 cjkcodecs/src/codecentry.h Index: codecentry.h =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/codecentry.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- codecentry.h 31 May 2003 11:50:19 -0000 1.1 +++ codecentry.h 6 Jun 2003 05:52:03 -0000 1.2 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: codecentry.h,v 1.1 2003/05/31 11:50:19 perky Exp $ + * $Id: codecentry.h,v 1.2 2003/06/06 05:52:03 perky Exp $ */ #ifdef HAVE_ENCODER_INIT @@ -118,6 +118,7 @@ Py_XDECREF(o); \ } +#ifndef CODEC_WITHOUT_MAPS static int importmap(PyObject *mod, const char *symbol, const struct unim_index **encmap, const struct dbcs_index **decmap) @@ -142,6 +143,7 @@ return 0; } +#endif static PyObject * createcodec(PyObject *cofunc, MultibyteCodec *codec) @@ -157,7 +159,6 @@ return r; } - /* * ex: ts=8 sts=4 et |
From: Hye-Shik C. <pe...@us...> - 2003-06-06 05:29:51
|
perky 03/06/05 22:29:50 Modified: . loginfo Log: just test. Revision Changes Path 1.3 +1 -1 CVSROOT/loginfo Index: loginfo =================================================================== RCS file: /cvsroot/koco/CVSROOT/loginfo,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- loginfo 1 Apr 2002 08:47:36 -0000 1.2 +++ loginfo 6 Jun 2003 05:29:50 -0000 1.3 @@ -24,4 +24,4 @@ #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog -DEFAULT /usr/bin/perl $CVSROOT/CVSROOT/log_accum.pl %s +DEFAULT $CVSROOT/CVSROOT/log_accum.pl %s |
From: Hye-Shik C. <pe...@us...> - 2003-06-05 10:24:01
|
perky 03/06/05 03:24:00 Added: tests downloadall.sh Log: Add a download tool. Revision Changes Path 1.1 cjkcodecs/tests/downloadall.sh Index: downloadall.sh =================================================================== #!/bin/sh # $Id: downloadall.sh,v 1.1 2003/06/05 10:23:58 perky Exp $ python testall.py|sed -n -e 's,^.*\(http[^ ]*\).*$,\1,p'|xargs -n1 wget |
From: Hye-Shik C. <pe...@us...> - 2003-06-05 10:21:20
|
perky 03/06/05 02:56:23 Modified: src _iso_2022_jp.c _iso_2022_jp_1.c multibytecodec.c Log: ISO-2022-JP and ISO-2022-JP-1 mandates to end with ASCII on G0. Revision Changes Path 1.4 +13 -1 cjkcodecs/src/_iso_2022_jp.c Index: _iso_2022_jp.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_iso_2022_jp.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- _iso_2022_jp.c 2 Jun 2003 10:36:03 -0000 1.3 +++ _iso_2022_jp.c 5 Jun 2003 09:56:21 -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: _iso_2022_jp.c,v 1.3 2003/06/02 10:36:03 perky Exp $ + * $Id: _iso_2022_jp.c,v 1.4 2003/06/05 09:56:21 perky Exp $ */ #include "codeccommon.h" @@ -42,6 +42,18 @@ state->i = 0; STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) + return 0; +} + +#define HAVE_ENCODER_RESET +ENCODER_RESET(iso_2022_jp) +{ + if (STATE_GETG0(state) != CHARSET_ASCII) { + RESERVE_OUTBUF(3) + PAVE3(ESC, '(', 'B') + STATE_SETG0(state, CHARSET_ASCII) + NEXT_OUT(3) + } return 0; } 1.3 +13 -1 cjkcodecs/src/_iso_2022_jp_1.c Index: _iso_2022_jp_1.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_iso_2022_jp_1.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- _iso_2022_jp_1.c 2 Jun 2003 10:43:41 -0000 1.2 +++ _iso_2022_jp_1.c 5 Jun 2003 09:56:22 -0000 1.3 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: _iso_2022_jp_1.c,v 1.2 2003/06/02 10:43:41 perky Exp $ + * $Id: _iso_2022_jp_1.c,v 1.3 2003/06/05 09:56:22 perky Exp $ */ #include "codeccommon.h" @@ -43,6 +43,18 @@ state->i = 0; STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) + return 0; +} + +#define HAVE_ENCODER_RESET +ENCODER_RESET(iso_2022_jp_1) +{ + if (STATE_GETG0(state) != CHARSET_ASCII) { + RESERVE_OUTBUF(3) + PAVE3(ESC, '(', 'B') + STATE_SETG0(state, CHARSET_ASCII) + NEXT_OUT(3) + } return 0; } 1.14 +20 -6 cjkcodecs/src/multibytecodec.c Index: multibytecodec.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/multibytecodec.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- multibytecodec.c 31 May 2003 11:50:19 -0000 1.13 +++ multibytecodec.c 5 Jun 2003 09:56:22 -0000 1.14 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: multibytecodec.c,v 1.13 2003/05/31 11:50:19 perky Exp $ + * $Id: multibytecodec.c,v 1.14 2003/06/05 09:56:22 perky Exp $ */ #include "Python.h" @@ -72,7 +72,8 @@ static char *streamkwarglist[] = {"stream", "errors", NULL}; static PyObject *multibytecodec_encode(MultibyteCodec *, - MultibyteCodec_State *, const Py_UNICODE *, int, PyObject *); + MultibyteCodec_State *, const Py_UNICODE *, int, PyObject *, + int flush); static PyObject *mbstreamreader_create(MultibyteCodec *, PyObject *, const char *); static PyObject *mbstreamwriter_create(MultibyteCodec *, @@ -261,7 +262,7 @@ } retstr = multibytecodec_encode(codec, state, PyUnicode_AS_UNICODE(tobj), - PyUnicode_GET_SIZE(tobj), ERROR_STRICT); + PyUnicode_GET_SIZE(tobj), ERROR_STRICT, 0); if (retstr == NULL) goto errorexit; @@ -401,7 +402,7 @@ multibytecodec_encode(MultibyteCodec *codec, MultibyteCodec_State *state, const Py_UNICODE *data, int datalen, - PyObject *errors) + PyObject *errors, int flush) { MultibyteEncodeBuffer buf; int finalsize; @@ -433,6 +434,19 @@ goto errorexit; } + if (flush && codec->encreset != NULL) + for (;;) { + int r; + size_t outleft; + + outleft = (size_t)(buf.outbuf_end - buf.outbuf); + r = codec->encreset(state, &buf.outbuf, outleft); + if (r == 0) + break; + else if (multibytecodec_encerror(codec, state, &buf, errors, r)) + goto errorexit; + } + finalsize = (int)((char*)buf.outbuf - PyString_AS_STRING(buf.outobj)); if (finalsize != PyString_GET_SIZE(buf.outobj)) @@ -468,7 +482,7 @@ if (self->codec->encinit != NULL && self->codec->encinit(&state) != 0) goto errorexit; - r = multibytecodec_encode(self->codec, &state, data, datalen, errorcb); + r = multibytecodec_encode(self->codec, &state, data, datalen, errorcb, 1); if (r == NULL) goto errorexit; @@ -914,7 +928,7 @@ return 0; r = multibytecodec_encode(self->codec, &self->state, - (Py_UNICODE *)PyUnicode_AS_UNICODE(unistr), rsize, self->errors); + (Py_UNICODE *)PyUnicode_AS_UNICODE(unistr), rsize, self->errors, 0); if (r == NULL) goto errorexit; |
From: Hye-Shik C. <pe...@us...> - 2003-06-05 10:20:27
|
perky 03/06/05 03:20:26 Modified: src/maps alg_jisx0201.h Log: Untab to spaces. Revision Changes Path 1.4 +2 -2 cjkcodecs/src/maps/alg_jisx0201.h Index: alg_jisx0201.h =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/maps/alg_jisx0201.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- alg_jisx0201.h 5 Jun 2003 10:18:10 -0000 1.3 +++ alg_jisx0201.h 5 Jun 2003 10:20:25 -0000 1.4 @@ -1,4 +1,4 @@ -/* $Id: alg_jisx0201.h,v 1.3 2003/06/05 10:18:10 perky Exp $ */ +/* $Id: alg_jisx0201.h,v 1.4 2003/06/05 10:20:25 perky Exp $ */ #define JISX0201_R_ENCODE(c, assi) \ if ((c) < 0x5c) (assi) = (c); \ @@ -19,7 +19,7 @@ else if ((c) < 0x7e) (assi) = (c); \ else if ((c) == 0x7e) (assi) = 0x203e; #define JISX0201_K_DECODE(c, assi) \ - if ((c) >= 0xa1 && (c) <= 0xdf) \ + if ((c) >= 0xa1 && (c) <= 0xdf) \ (assi) = 0xfec0 + (c); #define JISX0201_DECODE(c, assi) \ JISX0201_R_DECODE(c, assi) \ |
From: Hye-Shik C. <pe...@us...> - 2003-06-05 10:18:12
|
perky 03/06/05 03:18:11 Modified: src/maps alg_jisx0201.h Log: Fix a dumb typo. Found by: holy unittests :) Revision Changes Path 1.3 +4 -4 cjkcodecs/src/maps/alg_jisx0201.h Index: alg_jisx0201.h =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/maps/alg_jisx0201.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- alg_jisx0201.h 2 Jun 2003 09:25:17 -0000 1.2 +++ alg_jisx0201.h 5 Jun 2003 10:18:10 -0000 1.3 @@ -1,4 +1,4 @@ -/* $Id: alg_jisx0201.h,v 1.2 2003/06/02 09:25:17 perky Exp $ */ +/* $Id: alg_jisx0201.h,v 1.3 2003/06/05 10:18:10 perky Exp $ */ #define JISX0201_R_ENCODE(c, assi) \ if ((c) < 0x5c) (assi) = (c); \ @@ -19,8 +19,8 @@ else if ((c) < 0x7e) (assi) = (c); \ else if ((c) == 0x7e) (assi) = 0x203e; #define JISX0201_K_DECODE(c, assi) \ - else if ((c) >= 0xa1 && (c) <= 0xdf) \ + if ((c) >= 0xa1 && (c) <= 0xdf) \ (assi) = 0xfec0 + (c); #define JISX0201_DECODE(c, assi) \ - JISX0201_R_ENCODE(c, assi) \ - else JISX0201_K_ENCODE(c, assi) + JISX0201_R_DECODE(c, assi) \ + else JISX0201_K_DECODE(c, assi) |
From: Hye-Shik C. <pe...@us...> - 2003-06-05 09:58:54
|
perky 03/06/05 02:58:52 Added: . ROADMAP Log: Re-add ROADMAP Revision Changes Path 1.3 +30 -33 cjkcodecs/ROADMAP |
From: Hye-Shik C. <pe...@us...> - 2003-06-02 11:21:09
|
perky 03/06/02 04:21:06 Modified: tools genmap_support.py Log: Enable load sbcs mappings. Revision Changes Path 1.6 +6 -8 cjkcodecs/tools/genmap_support.py Index: genmap_support.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tools/genmap_support.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- genmap_support.py 17 May 2003 21:17:39 -0000 1.5 +++ genmap_support.py 2 Jun 2003 11:21:06 -0000 1.6 @@ -26,14 +26,14 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: genmap_support.py,v 1.5 2003/05/17 21:17:39 perky Exp $ +# $Id: genmap_support.py,v 1.6 2003/06/02 11:21:06 perky Exp $ # import re COPYRIGHT_HEADER = """\ /* - * $Id: genmap_support.py,v 1.5 2003/05/17 21:17:39 perky Exp $ + * $Id: genmap_support.py,v 1.6 2003/06/02 11:21:06 perky Exp $ */ """ re_UNIMAPDATE = re.compile('Date:\s*([ a-zA-Z0-9/]*)') @@ -142,15 +142,13 @@ print >> fo, "};" print >> fo -def loadmap(fo, sethighbit=0, natcol=0, unicol=1): +def loadmap(fo, natcol=0, unicol=1, sbcs=0): fo.seek(0, 0) head = fo.read(1024) mapdatever = '%s-%s' % ( re_UNIMAPVERSION.findall(head)[0], re_UNIMAPDATE.findall(head)[0] ) - if sethighbit: - sethighbit = 0x80 fo.seek(0, 0) decmap = {} @@ -160,9 +158,9 @@ row = map(eval, line.split()) loc, uni = row[natcol], row[unicol] - if loc >= 0x100: - decmap.setdefault((loc >> 8) | sethighbit, {}) - decmap[(loc >> 8)|sethighbit][(loc & 0xff)|sethighbit] = uni + if loc >= 0x100 or sbcs: + decmap.setdefault((loc >> 8), {}) + decmap[(loc >> 8)][(loc & 0xff)] = uni return mapdatever, decmap |
From: Hye-Shik C. <pe...@us...> - 2003-06-02 10:52:50
|
perky 03/06/02 03:52:48 Modified: src _iso_2022_kr.c Log: Utilize PAVE* macro Revision Changes Path 1.5 +6 -16 cjkcodecs/src/_iso_2022_kr.c Index: _iso_2022_kr.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_iso_2022_kr.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- _iso_2022_kr.c 2 Jun 2003 10:36:03 -0000 1.4 +++ _iso_2022_kr.c 2 Jun 2003 10:52:48 -0000 1.5 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: _iso_2022_kr.c,v 1.4 2003/06/02 10:36:03 perky Exp $ + * $Id: _iso_2022_kr.c,v 1.5 2003/06/02 10:52:48 perky Exp $ */ #include "codeccommon.h" @@ -64,14 +64,11 @@ if (c < 0x80) { if (STATE_GETFLAG(state, F_SHIFTED)) { - RESERVE_OUTBUF(2) + PAVE2(SI, c) STATE_CLEARFLAG(state, F_SHIFTED) - (*outbuf)[0] = SI; - (*outbuf)[1] = c; NEXT(1, 2) } else { - RESERVE_OUTBUF(1) - (*outbuf)[0] = c; + PAVE1(c) NEXT(1, 1) } if (c == '\n') @@ -79,28 +76,21 @@ } else UCS4INVALID(c) else { if (STATE_GETG1(state) != CHARSET_KSX1001) { - RESERVE_OUTBUF(4) + PAVE4(ESC, '$', ')', 'C') STATE_SETG1(state, CHARSET_KSX1001) - (*outbuf)[0] = ESC; - (*outbuf)[1] = '$'; - (*outbuf)[2] = ')'; - (*outbuf)[3] = 'C'; NEXT_OUT(4) } if (!STATE_GETFLAG(state, F_SHIFTED)) { - RESERVE_OUTBUF(1) + PAVE1(SO) STATE_SETFLAG(state, F_SHIFTED) - (*outbuf)[0] = SO; NEXT_OUT(1) } TRYMAP_ENC(cp949, code, c) { if (code & 0x8000) /* MSB set: CP949 */ return 1; - RESERVE_OUTBUF(1) - (*outbuf)[0] = code >> 8; - (*outbuf)[1] = code & 0xff; + PAVE2(code >> 8, code & 0xff) NEXT(1, 2) } else return 1; |
From: Hye-Shik C. <pe...@us...> - 2003-06-02 10:43:42
|
perky 03/06/02 03:43:41 Modified: src _iso_2022_jp_1.c Log: Correct comments Revision Changes Path 1.2 +3 -3 cjkcodecs/src/_iso_2022_jp_1.c Index: _iso_2022_jp_1.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_iso_2022_jp_1.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- _iso_2022_jp_1.c 2 Jun 2003 10:42:46 -0000 1.1 +++ _iso_2022_jp_1.c 2 Jun 2003 10:43:41 -0000 1.2 @@ -1,5 +1,5 @@ /* - * _iso_2022_jp_1.c: the ISO-2022-JP-1 codec (RFC1468) + * _iso_2022_jp_1.c: the ISO-2022-JP-1 codec (RFC2237) * * Copyright (C) 2003 Hye-Shik Chang <pe...@Fr...>. * All rights reserved. @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: _iso_2022_jp_1.c,v 1.1 2003/06/02 10:42:46 perky Exp $ + * $Id: _iso_2022_jp_1.c,v 1.2 2003/06/02 10:43:41 perky Exp $ */ #include "codeccommon.h" @@ -46,7 +46,7 @@ return 0; } -/* ISO-2022-JP changes designations instead of shifting-out */ +/* ISO-2022-JP-1 changes designations instead of shifting-out */ ENCODER(iso_2022_jp_1) { |
From: Hye-Shik C. <pe...@us...> - 2003-06-02 10:42:47
|
perky 03/06/02 03:42:46 Added: src _iso_2022_jp_1.c Log: Add a ISO-2022-JP-1 codec. Revision Changes Path 1.1 cjkcodecs/src/_iso_2022_jp_1.c Index: _iso_2022_jp_1.c =================================================================== /* * _iso_2022_jp_1.c: the ISO-2022-JP-1 codec (RFC1468) * * Copyright (C) 2003 Hye-Shik Chang <pe...@Fr...>. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * $Id: _iso_2022_jp_1.c,v 1.1 2003/06/02 10:42:46 perky Exp $ */ #include "codeccommon.h" #include "iso2022common.h" #include "maps/alg_jisx0201.h" ENCMAP(jisxcommon) DECMAP(jisx0208) DECMAP(jisx0212) #define HAVE_ENCODER_INIT ENCODER_INIT(iso_2022_jp_1) { state->i = 0; STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) return 0; } /* ISO-2022-JP changes designations instead of shifting-out */ ENCODER(iso_2022_jp_1) { while (inleft > 0) { Py_UNICODE c = **inbuf; DBCHAR code; if (c < 0x80) { switch (STATE_GETG0(state)) { case CHARSET_ASCII: PAVE1(c) NEXT(1, 1) break; case CHARSET_JISX0201_R: JISX0201_R_ENCODE(c, code) else { /* FALLTHROUGH (yay!) */ default: PAVE3(ESC, '(', 'B') NEXT_OUT(3) STATE_SETG0(state, CHARSET_ASCII) code = c; } PAVE1(code) NEXT(1, 1) break; } if (c == '\n') STATE_CLEARFLAG(state, F_SHIFTED) } else UCS4INVALID(c) else { unsigned char charset; charset = STATE_GETG0(state); if (charset == CHARSET_JISX0201_R) { code = DBCINV; JISX0201_R_ENCODE(c, code) if (code != DBCINV) { PAVE1(code) NEXT(1, 1) continue; } } TRYMAP_ENC(jisxcommon, code, c) { if (code & 0x8000) { /* MSB set: JIS X 0212 */ if (charset != CHARSET_JISX0212) { PAVE4(ESC, '$', '(', 'D') STATE_SETG0(state, CHARSET_JISX0212) NEXT_OUT(4) } PAVE2((code >> 8) & 0x7f, code & 0x7f) } else { /* MSB unset: JIS X 0208 */ if (charset != CHARSET_JISX0208) { PAVE3(ESC, '$', 'B') STATE_SETG0(state, CHARSET_JISX0208) NEXT_OUT(3) } PAVE2(code >> 8, code & 0xff) } NEXT(1, 2) } else { JISX0201_R_ENCODE(c, code) else return 1; /* if (charset == CHARSET_JISX0201_R) : already checked */ PAVE4(ESC, '(', 'J', code) STATE_SETG0(state, CHARSET_JISX0201_R) NEXT(1, 4) } } } return 0; } #define HAVE_DECODER_INIT DECODER_INIT(iso_2022_jp_1) { state->i = 0; STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) return 0; } #define HAVE_DECODER_RESET DECODER_RESET(iso_2022_jp_1) { STATE_CLEARFLAG(state, F_SHIFTED) return 0; } DECODER(iso_2022_jp_1) { while (inleft > 0) { unsigned char c = **inbuf; if (STATE_GETFLAG(state, F_ESCTHROUGHOUT)) { /* ESC throughout mode: for non-iso2022 escape sequences */ RESERVE_OUTBUF(1) **outbuf = c; /* assume as ISO-8859-1 */ NEXT(1, 1) if (IS_ESCEND(c)) { STATE_CLEARFLAG(state, F_ESCTHROUGHOUT) } continue; } switch (c) { case ESC: RESERVE_INBUF(2) if (IS_ISO2022ESC((*inbuf)[1])) { int eslen; eslen = iso2022esclen(*inbuf, inleft); if (eslen < 0) return eslen == MBERR_INTERNAL ? 1 : eslen; if (eslen == 3) { unsigned char charset; if ((*inbuf)[1] == '$') { if ((*inbuf)[2] == '@' || (*inbuf)[2] == 'B') { charset = (*inbuf)[2] | CHARSET_DOUBLEBYTE; STATE_SETG0(state, charset); } else return 3; } else { if ((*inbuf)[2] == 'B' || (*inbuf)[2] == 'J') charset = (*inbuf)[2]; else return 3; if ((*inbuf)[1] == '(') { STATE_SETG0(state, charset) } else if ((*inbuf)[1] == ')') { STATE_SETG1(state, charset) } else return 3; } } else if (eslen == 4) { if ((*inbuf)[1] == '$' && (*inbuf)[3] == 'D') { if ((*inbuf)[2] == '(') { STATE_SETG0(state, CHARSET_JISX0212) } else if ((*inbuf)[2] == ')') { STATE_SETG1(state, CHARSET_JISX0212) } else return 4; } else return 4; } else return eslen; NEXT_IN(eslen) } else { STATE_SETFLAG(state, F_ESCTHROUGHOUT) **outbuf = ESC; NEXT(1, 1) } break; case SI: STATE_CLEARFLAG(state, F_SHIFTED) NEXT_IN(1) break; case SO: STATE_SETFLAG(state, F_SHIFTED) NEXT_IN(1) break; case '\n': STATE_CLEARFLAG(state, F_SHIFTED) /* FALLTHROUGH */ case SP: /* FALLTHROUGH */ case DEL: RESERVE_OUTBUF(1) **outbuf = c; NEXT(1, 1) break; default: if ((c & 0x7f) < 0x20) { /* C0 and C1 */ RESERVE_OUTBUF(1) **outbuf = c & 0x7f; NEXT(1, 1) } else { unsigned char charset; if (!STATE_GETFLAG(state, F_SHIFTED) && c < 0x80) /* G0 */ charset = STATE_GETG0(state); else /* G1 */ charset = STATE_GETG1(state); if (charset & CHARSET_DOUBLEBYTE) { RESERVE_INBUF(2) RESERVE_OUTBUF(1) if (charset == CHARSET_JISX0208 || charset == CHARSET_JISX0208_O) { TRYMAP_DEC(jisx0208, **outbuf, c & 0x7f, (*inbuf)[1] & 0x7f); else return 2; } else if (charset == CHARSET_JISX0212) { TRYMAP_DEC(jisx0212, **outbuf, c & 0x7f, (*inbuf)[1] & 0x7f); else return 2; } else return MBERR_INTERNAL; NEXT(2, 1) } else if (charset == CHARSET_ASCII) { RESERVE_OUTBUF(1) **outbuf = c & 0x7f; NEXT(1, 1) } else if (charset == CHARSET_JISX0201_R) { RESERVE_OUTBUF(1) JISX0201_R_DECODE(c & 0x7f, **outbuf) else return 1; NEXT(1, 1) } else return MBERR_INTERNAL; } } } return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(iso_2022_jp_1) MAPOPEN(ja_JP) IMPORTMAP_DEC(jisx0208) IMPORTMAP_DEC(jisx0212) IMPORTMAP_ENC(jisxcommon) MAPCLOSE() END_CODEC_REGISTRY(iso_2022_jp_1) /* * ex: ts=8 sts=4 et */ |
From: Hye-Shik C. <pe...@us...> - 2003-06-02 10:42:47
|
perky 03/06/02 03:42:45 Modified: . setup.py Log: Add a ISO-2022-JP-1 codec. Revision Changes Path 1.19 +2 -2 cjkcodecs/setup.py Index: setup.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/setup.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- setup.py 2 Jun 2003 09:25:58 -0000 1.18 +++ setup.py 2 Jun 2003 10:42:45 -0000 1.19 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: setup.py,v 1.18 2003/06/02 09:25:58 perky Exp $ +# $Id: setup.py,v 1.19 2003/06/02 10:42:45 perky Exp $ # import sys @@ -36,7 +36,7 @@ extensions = [] encodings = { -'ja_JP': ['shift_jis', 'cp932', 'euc_jp', 'iso_2022_jp'], +'ja_JP': ['shift_jis', 'cp932', 'euc_jp', 'iso_2022_jp', 'iso_2022_jp_1'], 'ko_KR': ['euc_kr', 'cp949', 'johab', 'iso_2022_kr'], 'zh_CN': ['gb2312', 'gbk', 'gb18030', 'hz'], 'zh_TW': ['big5', 'cp950'], |
From: Hye-Shik C. <pe...@us...> - 2003-06-02 10:36:05
|
perky 03/06/02 03:36:04 Modified: src _iso_2022_jp.c _iso_2022_kr.c Log: Check if 2 bytes are available for double byte characters. Revision Changes Path 1.3 +2 -1 cjkcodecs/src/_iso_2022_jp.c Index: _iso_2022_jp.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_iso_2022_jp.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- _iso_2022_jp.c 2 Jun 2003 09:27:25 -0000 1.2 +++ _iso_2022_jp.c 2 Jun 2003 10:36:03 -0000 1.3 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: _iso_2022_jp.c,v 1.2 2003/06/02 09:27:25 perky Exp $ + * $Id: _iso_2022_jp.c,v 1.3 2003/06/02 10:36:03 perky Exp $ */ #include "codeccommon.h" @@ -220,6 +220,7 @@ if (charset & CHARSET_DOUBLEBYTE) { /* all double byte character sets are in JIS X 0208 here. * this means that we don't distinguish :1978 from :1983. */ + RESERVE_INBUF(2) RESERVE_OUTBUF(1) TRYMAP_DEC(jisx0208, **outbuf, c & 0x7f, (*inbuf)[1] & 0x7f) { 1.4 +2 -1 cjkcodecs/src/_iso_2022_kr.c Index: _iso_2022_kr.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/_iso_2022_kr.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- _iso_2022_kr.c 2 Jun 2003 08:43:20 -0000 1.3 +++ _iso_2022_kr.c 2 Jun 2003 10:36:03 -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: _iso_2022_kr.c,v 1.3 2003/06/02 08:43:20 perky Exp $ + * $Id: _iso_2022_kr.c,v 1.4 2003/06/02 10:36:03 perky Exp $ */ #include "codeccommon.h" @@ -214,6 +214,7 @@ if (charset & CHARSET_DOUBLEBYTE) { /* all double byte character sets are in KS X 1001 here */ + RESERVE_INBUF(2) RESERVE_OUTBUF(1) TRYMAP_DEC(ksx1001, **outbuf, c & 0x7f, (*inbuf)[1] & 0x7f){ NEXT(2, 1) |