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

Covers not displayed when path contains UTF-8 accentuated characters #16

Open
SR-G opened this issue Apr 16, 2013 · 3 comments
Open

Covers not displayed when path contains UTF-8 accentuated characters #16

SR-G opened this issue Apr 16, 2013 · 3 comments
Milestone

Comments

@SR-G
Copy link

SR-G commented Apr 16, 2013

Picture is not displayed ("broken image").
If i copy/paste the direct link address
(for example : http://192.168.1.4:8000/covers/Hom%C3%A8re-Liliade_et_lodyss%C3%A9e_illustr%C3%A9s.jpg )

Here is the error i get :
'ascii' codec can't encode character u'\xe8' in position 63: ordinal not in range(128)

Seems to be on the django-side.

Environment:


Request Method: GET
Request URL: http://192.168.1.4:8000/covers/Hom%C3%A8re-Liliade_et_lodyss%C3%A9e_illustr%C3%A9s.jpg

Django Version: 1.3.1
Python Version: 2.7.3
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'tagging',
 'pathagar.books']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.7/dist-packages/django/views/static.py" in serve
  46.     if os.path.isdir(fullpath):
File "/usr/lib/python2.7/genericpath.py" in isdir
  41.         st = os.stat(s)

Exception Type: UnicodeEncodeError at /covers/Homère-Liliade_et_lodyssée_illustrés.jpg
Exception Value: 'ascii' codec can't encode character u'\xe8' in position 63: ordinal not in range(128)

Correct filename on filesystem is :
Homère-Liliade_et_lodyssée_illustrés.jpg

@SR-G
Copy link
Author

SR-G commented Apr 17, 2013

Ok, i think you can forget about that one : my /etc/init.d/pathagar script hadn't those two lines :

export LANG='fr_FR.UTF-8'
export LC_ALL='fr_FR.UTF-8'

Once added, images with accentuated characters are now correctly displayed.

@lionaneesh
Copy link
Member

This should be closed. According to the bug reporter: exporting correct LANG's in the /etc/init.d/pathagar fixes the issue.

@sethwoodworth
Copy link
Contributor

This should be documented then closed

@adborden adborden added this to the 1.0 milestone Mar 29, 2015
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