Closed Bug 581933 Opened 11 years ago Closed 11 years ago

Username autocomplete doesn't work outside ASCII

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

3.7.2
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.0

People

(Reporter: Wurblzap, Assigned: mkanat)

References

Details

Attachments

(1 file)

If I enter a string containing non-ASCII characters in a autocomplete-enabled user field, no autocomplete search results are being shown even if what I entered is a substring of some account's real name.

Search: grmblfrx
Result: Gisudf Masägrmblfrxwerz <srtfuiawe@...>

Search: ägrmblfrx
Result: -none-

Can be reproduced on landfill.
For now, this is blocking 4.0, so that we can investigate it. However, I have a suspicion that this may be due to the UTF-8 behavior of JSON-RPC. If it is, it will probably be pretty tricky to fix. But it may still be fixable. If it isn't fixable for 4.0, then moving to RPC::Any will fix it, because I know that RPC::Any has working Unicode behavior.
Flags: blocking4.0+
Okay, I've confirmed this on the bugzilla-tip installation, and will be investigating the cause.
Okay, the problem is in our JavaScript. We're getting enteredText as a URL-escaped value, and when we do unescape on it, it becomes latin1 instead of UTF-8. We need to find out how to get the data out of the field without it becoming pre-escaped.
Attached patch v1Splinter Review
Turns out that the fix is really easy! We just have to use decodeURIComponent instead of unescape. For more info about the difference, see:

  http://xkr.us/articles/javascript/encode-compare/

Also, that other line of code didn't need the unescape--it wasn't getting URI-escaped data.
Assignee: create-and-change → mkanat
Status: NEW → ASSIGNED
Attachment #485454 - Flags: review?(wurblzap)
Comment on attachment 485454 [details] [diff] [review]
v1

Thanks, works as advertised :)
Attachment #485454 - Flags: review?(wurblzap) → review+
Depends on: 490923
Flags: approval4.0+
Flags: approval+
Target Milestone: --- → Bugzilla 4.0
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/                       
modified js/field.js
Committed revision 7576.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/4.0/                         
modified js/field.js
Committed revision 7462
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.