Opened 7 years ago

Closed 7 years ago

#28701 closed Bug (wontfix)

QueryDict processes some Unicode symbols incorrectly

Reported by: fresheed Owned by: nobody
Component: HTTP handling Version: 1.8
Severity: Normal Keywords: QueryDict, Unicode
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Using Django 1.8 I get strange result feeding QueryDict a string which contains Unicode U+00AB symbol. More concrete, first of two bytes is omitted.
Other randomly taken symbols are parsed correctly.

double_angle="value=%C2%AB" # «
yo="value=%D1%91" # ё
katakana="value=%E3%82%A1" # ァ

for qs in (double_angle, yo, katakana):
    dct=QueryDict(query_string=qs, encoding=None)
    print("%s -> %s" % (qs, dct))

Output:

value=%C2%AB -> <QueryDict: {u'value': [u'\xab']}>
value=%D1%91 -> <QueryDict: {u'value': [u'\u0451']}>
value=%E3%82%A1 -> <QueryDict: {u'value': [u'\u30a1']}>

Change History (3)

comment:1 by Tim Graham, 7 years ago

On Django master with Python 3 (Python 2 is no longer supported there), the output is:

value=%C2%AB -> <QueryDict: {'value': ['«']}>
value=%D1%91 -> <QueryDict: {'value': ['ё']}>
value=%E3%82%A1 -> <QueryDict: {'value': ['ァ']}>

It looks like that's correct behavior? If so, we can most likely close the issue. Per our supported versions policy, 1.8 is only receiving security and data loss fixes.

comment:2 by fresheed, 7 years ago

Ok, we'll move on to newer Django release

comment:3 by fresheed, 7 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top