Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with some characters #256

Open
npaladin2000 opened this issue Feb 4, 2023 · 3 comments
Open

Issue with some characters #256

npaladin2000 opened this issue Feb 4, 2023 · 3 comments

Comments

@npaladin2000
Copy link
Contributor

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

@ukos-git
Copy link
Contributor

ukos-git commented Apr 23, 2023

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.

@route('/library/<platform>/edit/<name>')
@authenticate
def edit(platform, name):
if platform in PLATFORM_HANDLERS:
if not authenticate_platform(platform):
return
content_id = name

content_id = request.query.name

@Slybo
Copy link

Slybo commented Feb 2, 2024

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.

@alkazar
Copy link
Member

alkazar commented Feb 3, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants