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

UNCONFIRMED
Unassigned

Status

()

defect
UNCONFIRMED
2 years ago
2 years ago

People

(Reporter: katsdaway, Unassigned)

Tracking

({testcase})

50 Branch
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
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.

Comment 1

2 years ago

Updated

2 years ago
Keywords: testcase
You need to log in before you can comment on or make changes to this bug.