Ticket #531 (closed defect: worksforme)
Special character encoding error in Linker/IE
| Reported by: | ray | Owned by: | gogo |
|---|---|---|---|
| Priority: | normal | Milestone: | Version 1.0 |
| Component: | Plugin_Linker | Version: | trunk |
| Severity: | normal | Keywords: | special character encoding |
| Cc: |
Description
In IE in the linker plugin when you select a link from the tree which contains special characters like umlauts they appear as UTF-8 (i.e. 'tückisch' becomes 'tückisch'), and that screws the link up.
I think the problem is the same as in #167, I could solve it by changing line 401 from
'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=decodeURIComponent(\'' + encodeURIComponent(files[i]) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);',
to
'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=unescape(\'' + escape(files[i]) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);',
and line 421 from
if(files[i].url) var link = 'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=decodeURIComponent(\'' + encodeURIComponent(files[i].url) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);';
to
if(files[i].url) var link = 'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=unescape(\'' + escape(files[i].url) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);';
that is using escape() instead of encodeURIComponent()
Change History
Note: See
TracTickets for help on using
tickets.
