|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:
"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].

-- 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|http://www.w3schools.com/tags/ref_urlencode.asp]. It decoded them by default. To fix this, please use the javascript [escape function|http://www.javascripter.net/faq/escape.htm] 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|http://xkr.us/articles/javascript/encode-compare/] --[DF|DirkFrederickx]

----

No longer an issue in the 2.3 series; we are not using the javascript popup window anymore.

-- JanneJalkanen