Title | Fail to attach a file to a page with multibyte page name |
Date | 28-Oct-2005 08:01:21 EEST |
Version | 2.2.23 |
Submitter | 148.87.1.171 |
Bug criticality | MediumBug |
Browser version | IE6.0 |
Bug status | ClosedBug |
PageProvider used | |
Servlet Container | |
Operating System | Windows 2000 |
URL | |
Java version |
Steps:
- create a page with multibyte page name
- attach a file to the page
Results:
- In the Add Attachment page, the page name becomes question marks like:

- Uploading a file will fail with the following error:
Works for me, even in sandbox.jspwiki.org. Downgrading. Anyone else have problems with IE?
My IE is Chinese native version. Please see the attachments: 1.gif and 2.gif.
-- ttao
Strange. Do you perhaps have your encoding set to Big-5 or something? Go to the settings menu (or something, I don't have an IE handy), and change the encoding to "auto" or "UTF-8" and let me know what happens.
The default encoding is UTF-8.
I know what happened. The javascript:window.open function in IE regards URLs as URL encoded. It decoded them by default. To fix this, please use the javascript escape function
to encode the page name like this:
<a href="javascript:window.open('Upload.jsp?page=%E4%B8%AD%E6%96%87','Upload','width=640,height=480,toolbar=1,menubar=1,scrollbars=1,resizable=1,').focus()">Attach file...</a>
-->
<a href="javascript:window.open('Upload.jsp?page='+escape('%E4%B8%AD%E6%96%87'),'Upload','width=640,height=480,toolbar=1,menubar=1,scrollbars=1,resizable=1,').focus()">Attach file...</a>
To avoid breaking the behaviors in other browsers, the change should be restricted within IE.
-- ttao
- Side remark : don't use escape() , use encodeURI() instead. See this article
--DF
No longer an issue in the 2.3 series; we are not using the javascript popup window anymore.