-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Adding book page has problems with Unicode ÄÖÜäöü or ß #3704
Comments
Trying to edit the book later, seems to produce the following error: https://openlibrary.org/books/OL28738926M/Das_gro%C3%9Fe_Buch_der_Dinosaurier/edit /opt/openlibrary/deploys/openlibrary/61096f2/openlibrary/templates/books/edit.html: error in processing template: UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 23: ordinal not in range(128) (falling back to default template) |
This is a recent Variation on an old problem, also discussed en passant at #2231. As a temporary workaround, the problematic correct spelling can be moved to the author’s a.k.a.s and the primary author name respelled to use plain ASCII. This done, the editions and works become accessible. |
@LeadSongDog This workaround helps with creating new books but OL28738926M can't be edited at all. |
This kinda incompatibility should disappear in the coming months when we switch to Python 3 because all str are Unicode in current versions of Python. It would be cool if someone could write some Python test cases that fail for this issue so that once they pass, we know we have made useful progress. Even a list of URLs would help especially if we could get some of those books loaded into dev/staging. |
I found this bug in names with "á", "é", "í", "ó", and "ú" (letters with accents). Also with the letter "ñ" in Spanish. Example: Isaías Rojas Peña (including "í" and "ñ"). |
Can we replicate this on http://staging.openlibrary.org which is now running on Python 3? |
This also presents a problem on Python 3.8.5 because we are attempting
|
@cclauss I got an internal server error on staging.openlibrary.org adding that: |
Correct... This is about Unicode characters vs. Ascii characters. Any Unicode character (even an emoji) will cause a problem on either Py2 or Py3. |
Hi, I'm getting a similar error when I try to edit this book: https://openlibrary.org/books/OL9174734M/Biblioteca_Vasconcelos_Library The error:
|
class OLIndexer() has a method normalize_edition_title() that seems to be converting Unicode titles into ASCII titles. ;-( |
The Problem also occours whent trying to edit an existing book where the authors name contains certain characters: |
Adding books containing a german ß in title oder ÄÖÜäöü or ß in the author name results in an error.
Evidence / Screenshot (if possible)
/opt/openlibrary/deploys/openlibrary/61096f2/openlibrary/templates/books/edit.html:
error in processing template: UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 9: ordinal not in range(128) (falling back to default template)Relevant url?
https://openlibrary.org/books/add
Steps to Reproduce
Details
The text was updated successfully, but these errors were encountered: