'GB2312'에 해당되는 글 1건

  1. GB2312 테이블 만들기 2008/06/04

GB2312 테이블 만들기

Posted at 2008/06/04 13:44// Posted in python
lines = []
for high in xrange(0, 0xff):
    highPart = high << 8
    line =""
    for low in xrange(0, 0xff):
        lowPart = low
        data = u"%c" % (highPart | lowPart)
        try:
            data.encode("gb2312")
        except UnicodeError:
            continue

        line += data

    if line:
        lines.append(line.encode("utf8"))

open("gb2312.txt", "w").write("\n".join(lines))

GB2312 테이블
이올린에 북마크하기(0) 이올린에 추천하기(0)
2008/06/04 13:44 2008/06/04 13:44
Tag ,