TitleFail to attach a file to a page with multibyte page name
Date28-Oct-2005 08:01:21 EEST
Version2.2.23
Submitter148.87.1.171
Bug criticalityMediumBug
Browser versionIE6.0
Bug statusClosedBug
PageProvider used
Servlet Container
Operating SystemWindows 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:
"http://sandbox.jspwiki.org/Upload.jsp?page=??-???"
  • Uploading a file will fail with the following error:
File could not be opened.

Works for me, even in sandbox.jspwiki.org. Downgrading. Anyone else have problems with IE?

-- JanneJalkanen


My IE is Chinese native version. Please see the attachments: 1.gif and 2.gif(info).

-- 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.

-- JanneJalkanen

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.

-- JanneJalkanen

Add new attachment

In order to upload a new attachment to this page, please use the following box to find the file, then click on “Upload”.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
gif
2.gif 0.6 kB 2 23-Sep-2006 14:01 220.225.35.3
« This page (revision-11) was last changed on 13-Apr-2006 23:21 by Janne Jalkanen