Closed Bug 519630 Opened 16 years ago Closed 1 year ago

embedded space in a local path is escaped incorrectly if double-byte characters are present in the pathname

Categories

(Core :: General, defect)

x86
Windows XP
defect

Tracking

()

RESOLVED INACTIVE

People

(Reporter: shum_bin, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729) Build Identifier: xulrunner runtime 1.9.1.3 I have a dotnet webbrowser application for testing with embedding mozilla via xpcom. The application navigates to a local html file which contain an IMG element like this <img src='file:///E:/Download/ChalkTestFiles/複製 -六月天空(简介)--原六月联盟2区核心团体一个崭新的世界.jpg'> There is a space at the left of the first hyphen. The application then save the document to another file with the method nsIWebBrowserPersist.SaveDocument(). In the saved file, the path is incorrectly escaped to : <img src="file:///E:/Download/ChalkTestFiles/%E8%A4%87%E8%A3%BD+-%E5%85%AD%E6%9C%88%E5%A4%A9%E7%A9%BA%28%E7%AE%80%E4%BB%8B%29--%E5%8E%9F%E5%85%AD%E6%9C%88%E8%81%94%E7%9B%9F2%E5%8C%BA%E6%A0%B8%E5%BF%83%E5%9B%A2%E4%BD%93%E4%B8%80%E4%B8%AA%E5%B4%AD%E6%96%B0%E7%9A%84%E4%B8%96%E7%95%8C.jpg"> Note that the space at the left of the first hyphen is now changed to a "+" which is incorrect. The path becomes unidentifiable. The same happens with nsIEditor.outputToString() method. The incorrect escape doesn't happen if there is no double-byte characters in the pathname. Reproducible: Always Steps to Reproduce: 1. navigate to an html file containing the element <img src='file:///E:/Download/ChalkTestFiles/複製 -六月天空(简介)--原六月联盟2区核心团体一个崭新的世界.jpg'> 2. check the innerhtml text of the document using nsIWebBrowserPersist.SaveDocument()or nsIEditor.outputToString() Actual Results: the path is incorrectly escaped to <img src="file:///E:/Download/ChalkTestFiles/%E8%A4%87%E8%A3%BD+-%E5%85%AD%E6%9C%88%E5%A4%A9%E7%A9%BA%28%E7%AE%80%E4%BB%8B%29--%E5%8E%9F%E5%85%AD%E6%9C%88%E8%81%94%E7%9B%9F2%E5%8C%BA%E6%A0%B8%E5%BF%83%E5%9B%A2%E4%BD%93%E4%B8%80%E4%B8%AA%E5%B4%AD%E6%96%B0%E7%9A%84%E4%B8%96%E7%95%8C.jpg"> with the space escaped to a "+" Expected Results: The space should be escaped to rather than %20 rather than a "+" This happens only when the space is in between double-bytes characters, i.e. the escape is ok if the space is between normal ascii characters.
Severity: normal → S3

no activity for a while and no comment, closing.

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.