Homec4science

Fix phutil_utf8_console_strlen() for combining characters

Authored by epriestley <git@epriestley.com> on Jun 15 2014, 19:51.

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

Committed
epriestley <git@epriestley.com>Jun 15 2014, 19:51
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU4db5304f0f68: Update `.gitignore`.
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUfe71010796fb: Fix phutil_utf8_console_strlen() for combining characters (authored by epriestley <git@epriestley.com>).Jun 15 2014, 19:51