Unicode strings stored by util.file can come back mangled
Bug #1641208 reported by
Galen Charlton
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
ÑØÖÜÔáØáÐ
Changed in evergreen: | |
importance: | Undecided → Medium |
milestone: | none → 2.11.1 |
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) |
Changed in evergreen: | |
assignee: | Jason Etheridge (phasefx) → nobody |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
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. icodeConverter in get_object/ write_object, convert the non-ASCII characters to Unicode escape sequences after producing the JSON.
- instead of using nsIScriptableUn