Page MenuHomePhabricator

Fix phutil_utf8_console_strlen() for combining characters
ClosedPublic

Authored by epriestley on Jun 15 2014, 1:08 PM.
Tags
None
Referenced Files
F13987835: D9546.diff
Mon, Oct 21, 11:36 AM
F13984467: D9546.id.diff
Sun, Oct 20, 1:36 PM
F13956342: D9546.id22879.diff
Mon, Oct 14, 5:14 AM
Unknown Object (File)
Fri, Oct 11, 1:43 AM
Unknown Object (File)
Sep 15 2024, 7:25 AM
Unknown Object (File)
Aug 29 2024, 7:50 PM
Unknown Object (File)
Aug 27 2024, 10:55 PM
Unknown Object (File)
Aug 19 2024, 3:00 AM
Subscribers

Details

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.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

epriestley retitled this revision from to Fix phutil_utf8_console_strlen() for combining characters.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: joshuaspence.
joshuaspence edited edge metadata.

This fixes my issue.

This revision is now accepted and ready to land.Jun 15 2014, 5:42 PM
epriestley updated this revision to Diff 22891.

Closed by commit rPHUfe71010796fb (authored by @epriestley).