소스 검색

* Fixed utf32_to_utf8 function.

tags/v0.99.beta18
Alex Foulon alxf 14 년 전
부모
커밋
0319420c90
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. +5
    -3
      python/caca/common.py

+ 5
- 3
python/caca/common.py 파일 보기

@@ -275,7 +275,9 @@ def utf8_to_utf32(ch):

ch -- the character to convert
"""
_lib.caca_utf8_to_utf32.argtypes = [ctypes.c_char_p, ctypes.POINTER(ctypes.c_size_t)]
_lib.caca_utf8_to_utf32.argtypes = [ctypes.c_char_p,
ctypes.POINTER(ctypes.c_size_t)
]
_lib.caca_utf8_to_utf32.restype = ctypes.c_uint32

return _lib.caca_utf8_to_utf32(ch, ctypes.c_ulong(0))
@@ -288,10 +290,10 @@ def utf32_to_utf8(ch):
_lib.caca_utf32_to_utf8.argtypes = [ctypes.c_char_p, ctypes.c_uint32]
_lib.caca_utf32_to_utf8.restype = ctypes.c_int

buf = ctypes.c_buffer(2)
buf = ctypes.c_buffer(7)
_lib.caca_utf32_to_utf8(buf, ch)

return buf
return buf.raw.rstrip('\x00')

def utf32_to_cp437(ch):
""" Convert a UTF-32 character to CP437.


불러오는 중...
취소
저장