Closed Bug 346482 Opened 18 years ago Closed 18 years ago

Backspace deletes only half of UTF16 character (outside BMP) in text widgets

Categories

(Core :: General, defect)

1.8 Branch
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 237585

People

(Reporter: buginnocent, Unassigned)

Details

The Unicode Basic Multilingual Plane is U+0000 to U+FFFF, characters outside this range can be entered into an entry widget, e.g. the Location Bar, but if the user hits backspace, the contents of the Location Bar vanish, internally data corruption is occuring. You can test this by pasting _at the end of some existing text_ 䕫 (U+2F9B2) or entering it yourself using a suitable entry method, on Linux systems hold CTRL+SHIFT then type U followed by the hex digits and release. Now press backspace to see the bug in action... Inside Gecko Unicode characters are represented not as UTF-8 but as UTF-16, an encoding in which characters outside the BMP are treated specially. These characters are represented as two code points (surrogates), and it appears that Firefox deletes a /code point/ rather than a /character/ when backspace is pressed. The result is that the text widget's contents are no longer a valid Unicode string. In fact, this bug appears to occur throughout Firefox/ Mozilla/ etc. anywhere that text entry widgets are used. Please identify the right Component for this bug if you have the ability to do so in order that the right developer sees this report and can fix the problem. If you can verify that this bug does (or does not) occur on another OS platform, please comment to that effect.
That should say /code units/ not code points of course, wherever I wrote that. Not enough sleep.
Product: Firefox → Core
QA Contact: general → general
Version: 1.5.0.x Branch → 1.8 Branch
This is fixed on trunk for text widgets, however the equivalent bug for HTML editing, bug 332636, is not yet fixed *** This bug has been marked as a duplicate of 237585 ***
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.