libtcod / python-tcod

A high-performance Python port of libtcod. Includes the libtcodpy module for backwards compatibility with older projects.
BSD 2-Clause "Simplified" License
404 stars 37 forks source link

Unable to print ascii 127 (del) #122

Closed LordKaT closed 1 year ago

LordKaT commented 1 year ago

both print and put_char fail to print character 127 to the console. Technically not incorrect on modern systems since it's the delete keystroke on terminals, but it *could display the house icon when attempting to render codepage 437. PReviously, on 13.x you could use put_char to force character 127 to the terminal (print() wouldn't work)

LordKaT commented 1 year ago

Nevermind, I jumped the gun! In previous versions (13.x) you needed to use 0x007F to put_char 127 to the terminal, and the unicode 0x2302 would fail to print anything. The latest version (14.x) fixes this and uses the proper unicode character mapping.

HexDecimal commented 1 year ago

This was a known braking change, documented in the changelog and marked with a major version increment. This change will stay in effect as 127 was never a printable character.

You can manually clone glyphs to other codepoints using the tileset API:

new_tileset.set_tile(0x7f, new_tileset.get_tile(0x2302))

This should reproduce the previous behavior, without affecting the new behavior.