Changeset 4771 for libcaca


Ignore:
Timestamp:
Feb 18, 2011, 8:03:44 PM (8 years ago)
Author:
Alex Foulon
Message:
  • method Canvas.put_char now handle utf8 char.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/python/caca/canvas.py

    r4770 r4771  
    1717import ctypes
    1818
    19 from caca import _lib
     19from caca import _lib, utf8_to_utf32
    2020from caca.font import _Font
    2121
     
    162162        _lib.caca_put_char.restype  = ctypes.c_int
    163163
    164         return _lib.caca_put_char(self, x, y, ord(ch))
     164        try:
     165            ch = ord(ch)
     166        except TypeError:
     167            ch = utf8_to_utf32(ch)
     168
     169        return _lib.caca_put_char(self, x, y, ch)
    165170
    166171    def get_char(self, x, y):
Note: See TracChangeset for help on using the changeset viewer.