chimera
chimera copied to clipboard
Issue with some characters
Noticed this when uploading a Pokemon ROM, the searches find it with the spelling "Pokémon" and that's how it writes the YAML file, but the web server doesn't seem to handle the "é" character cleanly and the resulting new entry produces an error 400 when trying to access it, "Sorry, the requested URL 'http://192.168.1.113/library/gba/edit/Pok%C3%A9mon%20Pinball' caused an error: Invalid path string. Expected UTF-8."
The YAML file has it formatted as home/gamer/.local/share/chimera/images/poster/gba/Pok\xE9mon Pinball.png
Confirmed. Adding some info to this.
>>> import urllib.parse
>>> s =urllib.parse.unquote('http://127.0.0.1/library/gba/edit/Pok%C3%A9mon%20Pinball')
>>> s
'http://127.0.0.1/library/gba/edit/Pokémon Pinball'
>>> s.encode('iso-8859-1')
b'http://127.0.0.1/library/gba/edit/Pok\xe9mon Pinball'
YAML file content should be encoded in utf-8
and url probably needs to be decoded.
Bottle should decode all parameters as utf-8. I would suggest to try to use the request class here but I only have a "production" setup here.
https://github.com/ChimeraOS/chimera/blob/29e59a08ade9cd6086fcbe3506d485bfc9277e9a/chimera_app/server.py#L196-L203
content_id = request.query.name
I came here to post this same issue. Special characters will not display in the web UI and you get an error message (shown above) when you attempt to edit the entry.
I took another crack at this and finally figured it out. The issue ended up being the use of the paste
backend server. Replacing it with an alternative backend seems to do the trick. Should be fixed in an upcoming release.