dansanderson / picotool

Tools and Python libraries for manipulating Pico-8 game files. http://www.lexaloffle.com/pico-8.php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Glyph support

dansanderson opened this issue · comments

Picotool currently uses the 'ascii' encoding when reading and writing .p8 files. I believe this would fail when code contains glyphs.

The glyph representation in .p8 files has changed as of 0.1.11e to use a UTF-8 encoding, so it's likely that the correct solution is to switch to that encoding, then carefully make sure these sequences are converted to binary correctly. It might be worth accepting only the narrowest range of supported code points and not all UTF-8 values. IIRC previous behavior with high chars in Lua source was undefined in Pico-8, usually accepted silently or possibly converted invisibly.

Also, glyphs can now be used in identifiers, so this likely requires an update to the lexer.

picotool now treats all Lua code as P8SCII bytestrings internally. When loading and saving .p8 files, P8SCII is converted from and to Unicode by a fixed mapping of the set of 256 characters.

750301a adds support for high chars in glyphs.