Closed Bug 451142 Opened 17 years ago Closed 15 years ago

execCommand(CreateLink) produces double utf-8 encoding of domain names containing utf-8 characters

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: stanislas.rolland, Unassigned)

Details

(Whiteboard: [CLOSEME 2010-11-01])

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 When designMode is set on a document, executing, for example, document.execCommand("CreateLink", false, "http://www.städtlifest.ch/")) results in a a-tag in which href contains a double utf-8 encoded byte: http://www.städtlifest.ch/. Reproducible: Always Steps to Reproduce: 1. Set designMode on document 2. Enter and select some text 3. Execute document.execCommand("CreateLink", false, "http://www.städtlifest.ch/")) Actual Results: href of resulting link is http://www.städtlifest.ch/ The link is not usable. Expected Results: href should be http://www.städtlifest.ch/
I found a workaround for this issue: Invoke encodeURIComponent before invoking the CrateLink execCommand, as follows: document.execCommand("CreateLink", false, encodeURIComponent("http://www.städtlifest.ch/")) Then, invoke decodeURIComponent on the href attribute of each of the created links.
This is a mass search for bugs which are in the Firefox General component, are UNCO, have not been changed for 500 days and have an unspecified version. Reporter, can you please update to Firefox 3.6.10 or later, create a fresh profile, http://support.mozilla.com/en-US/kb/managing+profiles, and test again. If you still see the issue, please update this bug. If the issue is gone, please set the status to RESOLVED > WORKSFORME.
Whiteboard: [CLOSEME 2010-11-01]
No reply from reporter, INCOMPLETE. Please retest with Firefox 3.6.12 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INCOMPLETE
I am still seeing this issue with Firefox 27.0.1. This should be fixed because UTF-8 characters are a common part of URLs nowadays. The workaround proposed in https://bugzilla.mozilla.org/show_bug.cgi?id=451142#c1 kind of works but it should really not be necessary. It creates quite some overhead as well.
You need to log in before you can comment on or make changes to this bug.