Opened 9 years ago
Closed 9 years ago
#13187 closed defect (fixed)
[PATCH] Set encoding of remote control error pages to UTF-8 and HTML-escape the localized messages
| Reported by: | floscher | Owned by: | floscher |
|---|---|---|---|
| Priority: | normal | Milestone: | 16.07 |
| Component: | Core remotecontrol | Version: | latest |
| Keywords: | encoding html | Cc: |
Description
Currently the error pages of the remote control are delivered to the browser without information about the encoding (neither via HTTP-header nor via <meta>-tag in the HTML), while in fact the pages are encoded with UTF-8. So these pages are displayed incorrectly when the user has not set UTF-8 as default encoding in his/her browser and the page contains special characters like Umlauts.
An example is http://127.0.0.1:8111/load_and_zoom?right=0&top=0&left=1&bottom=1 when you set the display language of JOSM to German. Then the page reads Die Minima müssen geringer als die Maxima sein.
This patch both adds the encoding to the HTTP-header and adds <meta charset="utf8"> to the HTML of the error pages. Additionally it also adds HTML-escaping to the localized messages, so they could even contain <, > or & and still be displayed correctly.
The patch has been created against version 10583 and is attached to this ticket, or can be viewed at
https://github.com/floscher/josm/commit/776bb6d8b1a0e35492151835f7ac612ede1f8596 (Raw patch, Raw diff)
Attachments (2)
Change History (8)
by , 9 years ago
| Attachment: | 776bb6d8b1a0e35492151835f7ac612ede1f8596.patch added |
|---|
comment:1 by , 9 years ago
comment:2 by , 9 years ago
| Milestone: | → 16.07 |
|---|
comment:3 by , 9 years ago
| Component: | Core → Core remotecontrol |
|---|---|
| Keywords: | encoding html added; remotecontrol removed |
comment:4 by , 9 years ago
| Status: | new → needinfo |
|---|
Looks good, thanks for the patch :) Can you please update it by taking into account Dirk's remarks, then I'll commit it?
by , 9 years ago
| Attachment: | 59c2a1c268fc1f309258b75729b5bd450331ec22.patch added |
|---|
comment:5 by , 9 years ago
Thank you for the review. I attached the improved patch taking both suggestions into account.



Two points:
tr("The following keys are mandatory, but have not been provided: {0}", Utils.join(", ", missingKeys)));