The problem is python cannot decode my language (Thai) character using
utf8 which is default.
Moreover, Django doesn't use character settings (DEFAULT_CHARSET) at
beginning of processing of request.
At,
\django\core\handlers\wsgi.py",
line 78, in __init__
self.path = force_unicode(environ['PATH_INFO'])
I change it to,
self.path = force_unicode(environ['PATH_INFO'],
encoding=settings.DEFAULT_CHARSET)
It works properly.
Any comment?
Chatchai
On Apr 30, 9:12 pm, chatchai <[EMAIL PROTECTED]> wrote:
> Hi,
> With Django trunk version, when make a web request with following URL,
> Django return 400 client error,
>
> -http://localhost/%A1(-http://localhost/ก)
>
> Below is exception details,
>
> Traceback (most recent call last):
> File "D:\projects\simple\userprofile\tests.py", line 12, in
> test_details
> response = self.client.get('/ก/')
> File "C:\Python25\lib\site-packages\django\test\client.py", line
> 218, in get
> return self.request(**r)
> File "C:\Python25\lib\site-packages\django\test\client.py", line
> 170, in request
> response = self.handler(environ)
> File "C:\Python25\lib\site-packages\django\test\client.py", line 38,
> in __call__
> request = WSGIRequest(environ)
> File "C:\Python25\lib\site-packages\django\core\handlers\wsgi.py",
> line 78, in __init__
> self.path = force_unicode(environ['PATH_INFO'])
> File "C:\Python25\lib\site-packages\django\utils\encoding.py", line
> 60, in force_unicode
> raise DjangoUnicodeDecodeError(s, *e.args)
> DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0xa1 in
> position 1: unexpected code byte. You passed in '/\xa1/
> ' (<type 'str'>)
>
> Is it normal or something wrong?
>
> Thanks
>
> Chatchai
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---