Open Bug 1324907 Opened 4 years ago Updated 4 years ago

getSelection().toString() incorrectly converts non-break space to normal space

Categories

(Core :: DOM: Selection, defect)

50 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

UNCONFIRMED

People

(Reporter: katsdaway, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file)

I am trying to get the current selected text which contains a non-break space character for example the following in HTML

non-breaking space

using window.getSelection().toString(). However on encoding the result as a URI I get

non-breaking%20space

but in UTF-8 the result should be 

non-breaking%C2%A0space

Demo of the issue: https://kartikprabhu.com/static/demo/selection-encodeURI.html

Feel free to copy the JS inline if need be.
Keywords: testcase
You need to log in before you can comment on or make changes to this bug.