HomePhabricator

Fix phutil_utf8_console_strlen() for combining characters

Description

Fix phutil_utf8_console_strlen() for combining characters

Summary:
See D9533. We currently count the length of combining characters incorrectly.

Instead, break the string into glyphs first, then only count the length of the base character in each glyph, ignoring combining characters.

Test Plan: Added some unit tests.

Reviewers: joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D9546

Details

Provenance
epriestleyAuthored on
epriestleyPushed on Jun 15 2014, 5:51 PM
Reviewer
joshuaspence
Differential Revision
D9546: Fix phutil_utf8_console_strlen() for combining characters
Parents
rPHU4db5304f0f68: Update `.gitignore`.
Branches
Unknown
Tags
Unknown

Event Timeline