chimera icon indicating copy to clipboard operation
chimera copied to clipboard

Issue with some characters

Open npaladin2000 opened this issue 2 years ago • 3 comments

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

npaladin2000 avatar Feb 04 '23 21:02 npaladin2000

Confirmed. Adding some info to this.

image

>>> 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

ukos-git avatar Apr 23 '23 21:04 ukos-git

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.

Slybo avatar Feb 02 '24 13:02 Slybo

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.

alkazar avatar Feb 03 '24 21:02 alkazar