unicode box drawing

jefm jef.mangelschots at gmail.com
Tue Mar 4 18:51:49 CET 2008


How can I print the unicode box drawing characters in python:


print u'\u2500'
print u'\u2501'
print u'\u2502'
print u'\u2503'
print u'\u2504'

Traceback (most recent call last):
  File "\test.py", line 3, in ?
    print u'\u2500'
  File "C:\Python24\lib\encodings\cp1252.py", line 18, in encode
    return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u2500'
in position 0: character maps to <undefined>



More information about the Python-list mailing list