Javascript URL with non-ascii character becomes garbled.

RESOLVED DUPLICATE of bug 51355

Status

()

Core
Networking
RESOLVED DUPLICATE of bug 51355
17 years ago
15 years ago

People

(Reporter: Daniel Bratell, Assigned: neeti)

Tracking

({intl})

Trunk
Future
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

17 years ago
The html below doesn't work in Mozilla because the url is quoted.

<html><body>
<a href="javascript:alert('Hej och hå');">foo</a>
</body></html>

Mousing over the link shows that it turned into:
   javascript:alert(%27Hej%20och%20h%E5%27);
which isn't legal Javascript. Clicking it makes the javascript engine yell about
syntax errors. If I remove the å, I get the normal:
   javascript:alert('Hej och h');
and the url works fine. In MSIE both url:s are working fine.

I don't know the rules for javascript url:s but, even if å has to be quoted into
%E5, the rest of the code shouldn't be touched.

Real world example: Open the URL http://web.bratell.nu/andreas/pictures.asp and
try to click on a picture. A new window should open, but instead we get syntax
errors from javascript.

This was tested on Windows 2000 with a build built today (2000-12-19).

Comment 1

17 years ago
Actually, this should be escaped (it's supposed to be an URI[0]), so I guess it 
should be unescaped before handing it to the JS engine. I strongly suspect this 
to be a dupe of an existing bug.

[0] http://www.w3.org/TR/html4/struct/links.html#adef-href
(Assignee)

Updated

17 years ago
Target Milestone: --- → Future

Comment 2

17 years ago
Could be a dupe of one of these bugs:

                           bug 55468
                           bug 66055
                           bug 70873 

Comment 3

17 years ago
Added intl keyword.
Keywords: intl

Comment 4

17 years ago
This WW3 link may be of interest:

     http://www.w3.org/TR/html4/appendix/notes.html#non-ascii-chars


I believe this bug is a duplicate of bug 51355:

         "javascript:code" doesn't work in hrefs properly"

Comment 5

17 years ago

*** This bug has been marked as a duplicate of 51355 ***
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → DUPLICATE

Updated

15 years ago
QA Contact: tever → benc
You need to log in before you can comment on or make changes to this bug.