Closed Bug 77043 Opened 23 years ago Closed 23 years ago

HTML special characters and entities not working in HREFs

Categories

(Core :: DOM: HTML Parser, defect)

x86
All
defect
Not set
blocker

Tracking

()

VERIFIED DUPLICATE of bug 51355

People

(Reporter: abo, Assigned: harishd)

References

()

Details

Attachments

(2 files)

When a string argument is passed to a javascript function containing HTML
special characters or entitities (like "ÄÖÜäöü" or
"ÄÖÜäöü") javascript will stop execution and
nothing will happen any more. IE can handle such arguments correctly. See the
URL given above for an example.
Special characters are handled just fine by JavaScript.

To show this, try:
<a href="#" onclick="display_message('&Auml;&Ouml;&Uuml; ִײ� &auml;&ouml;&uuml;
הצ�');">

...it works correctly.

What is happening in the testcase is that the special-character entities are
being translated, THEN url-encoded since they are in an href="".

For some reason, though, the single-quotes are being dropped and thus the
function parameter is not being passed as a string, giving a JS error.  This
seems to be a url-encoding issue.
What is happening in the testcase is that the special-character entities are 
being translated, THEN url-encoded since they are in an href="".

For some reason, though, the single-quotes are being dropped and thus the 
function parameter is not being passed as a string, giving a JS error.  This 
seems to be a url-encoding issue.
In NN4.7, both anchors in the above testcase behave the same: you 
get the same alert with foreign characters in each case.

In Mozilla/N6, the onClick example works fine, but the HREF example
errors in the JavaScript Console and produces no alert. 

Reassigning to Parser component - this may simply be a duplicate 
of bug 51355. 
Assignee: rogerl → harishd
Status: UNCONFIRMED → NEW
Component: Javascript Engine → Parser
Ever confirmed: true
OS: Windows 2000 → All
QA Contact: pschwartau → bsharma
Summary: JavaScript can't handle HTML special characters and entities → HTML special characters and entities not working in HREFs

*** This bug has been marked as a duplicate of 51355 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
verified dup.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: