Unicode strings stored by util.file can come back mangled

Bug #1641208 reported by Galen Charlton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
2.11
Fix Released
Medium
Unassigned

Bug Description

Some interfaces in the XUL client, such as the transit list, build org unit selectors by reading the names and IDs of OUs from the offline_ou_list XUL profile file that's initialized during login. However, since at the moment util.file doesn't account for the fact that nsIOutputStream (and children) expect JavaScript clients to only write ASCII data, non-ASCII OU names can get mangled. E.g.,

ბიზნესისა

can become

ÑØÖÜÔáØáÐ

Tags: pullrequest
Galen Charlton (gmc)
Changed in evergreen:
importance: Undecided → Medium
milestone: none → 2.11.1
Revision history for this message
Galen Charlton (gmc) wrote :

A patch is available at the tip of the user/gmcharlt/lp1641208_unmangle_utf8_in_utl_file branch in the working/Evergreen repository:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/gmcharlt/lp1641208_unmangle_utf8_in_utl_file

I can think of a couple other ways to implement this:

- move the conversion to write_content/get_content so that all uses of util.file will get the conversion, which would cover more ground (e.g., receipts) but require more testing.
- instead of using nsIScriptableUnicodeConverter in get_object/write_object, convert the non-ASCII characters to Unicode escape sequences after producing the JSON.

tags: added: pullrequest
Changed in evergreen:
milestone: 2.11.1 → 2.next
status: New → Fix Committed
status: Fix Committed → New
no longer affects: evergreen/2.10
Changed in evergreen:
milestone: 3.next → 2.12.2
Changed in evergreen:
assignee: nobody → Jason Etheridge (phasefx)
Revision history for this message
Jason Etheridge (phasefx) wrote :

Thanks Galen! I also tried a compiled client and confirmed that it fixes manifestations of this bug in workstation registration and offline patron registration.

Pushed to master, rel_2_11, and rel_2_12

Changed in evergreen:
status: New → Fix Committed
Changed in evergreen:
assignee: Jason Etheridge (phasefx) → nobody
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.