Closed Bug 503520 Opened 17 years ago Closed 16 years ago

we need to pass mb_strlen() an encoding parameter or it's not accurate

Categories

(addons.mozilla.org Graveyard :: Public Pages, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 512766

People

(Reporter: clouserw, Assigned: Milos)

Details

(Whiteboard: [patch])

Attachments

(1 file)

Bug 503502 makes note that mb_strlen() is inaccurate unless we pass it 'utf-8' as it's encoding. Grepping through our tree shows mb_strlen() used a half dozen times but never with a specified encoding. Example File: $x = '海'; echo "no encoding: " .mb_strlen($x)."\n"; echo "with encoding: " .mb_strlen($x, 'UTF-8')."\n" Example Output (run on khan): no encoding: 3 with encoding: 1
This should be a quick fix but we'll want to test it out too to make sure stuff isn't depending on the broken code.
Assignee: nobody → bmo
Target Milestone: --- → 5.1
Attached patch patch v1Splinter Review
Attachment #395954 - Flags: review?(clouserw)
If we plan to do some thorough testing, maybe we should file a new one for it.
Status: NEW → ASSIGNED
Whiteboard: [patch]
I know I filed this and asked you to patch it, but in the mean time bug 512766 was filed and it makes more sense to do it that way so I'm forward duping this.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
Attachment #395954 - Flags: review?(clouserw)
Status: RESOLVED → VERIFIED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: