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

VERIFIED DUPLICATE of bug 512766

Status

addons.mozilla.org Graveyard
Public Pages
VERIFIED DUPLICATE of bug 512766
9 years ago
2 years ago

People

(Reporter: clouserw, Assigned: Milos)

Tracking

unspecified

Details

(Whiteboard: [patch])

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
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
(Reporter)

Comment 1

8 years ago
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
(Assignee)

Comment 2

8 years ago
Created attachment 395954 [details] [diff] [review]
patch v1
Attachment #395954 - Flags: review?(clouserw)
(Assignee)

Comment 3

8 years ago
If we plan to do some thorough testing, maybe we should file a new one for it.
Status: NEW → ASSIGNED
(Reporter)

Updated

8 years ago
Whiteboard: [patch]
(Reporter)

Comment 4

8 years ago
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
Last Resolved: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 512766
(Reporter)

Updated

8 years ago
Attachment #395954 - Flags: review?(clouserw)
(Assignee)

Updated

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