Closed Bug 299111 Opened 19 years ago Closed 19 years ago

CountValidUTF8Bytes doesn't take surrogates into account

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: smontagu, Assigned: smontagu)

Details

Attachments

(1 file, 1 obsolete file)

This was fixed for CalculateUTF8Length in bug 172700.
UTF8InputStream::CountValidUTF8Bytes needs the same fix.
Attached patch patch (obsolete) — Splinter Review
This patch shows the semantic change, but I think while I'm here I'll change
some of the data names. "ucs2bytes" is doubly misnamed.
Attachment #187636 - Attachment is obsolete: true
Attachment #187639 - Flags: superreview?(dbaron)
Attachment #187639 - Flags: review?(darin)
Comment on attachment 187639 [details] [diff] [review]
Patch with name changes

sr=dbaron, although I dislike some of the new names:  in particular, this is
counting 2-byte units, not UTF-16 characters, some of which are 2 bytes and
some of which are 4 bytes.
Attachment #187639 - Flags: superreview?(dbaron) → superreview+
I'm not wild about "UTF16chars" either. If I think of something better I'll
change it before checking in.
Attachment #187639 - Flags: review?(darin) → review+
Target Milestone: --- → mozilla1.9alpha
How about |utf16Codeunits| or |utf16Units|? 'code unit' is used in the unicode
standard. Our string document uses it, too.

Checked in with the name "UTF16CodeUnits"
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: