Page MenuHomePhabricator

Fix phutil_is_utf8_with_only_bmp_characters() for partial valid characters
ClosedPublic

Authored by epriestley on Feb 24 2014, 7:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 3, 10:21 AM
Unknown Object (File)
Sun, Apr 28, 5:20 AM
Unknown Object (File)
Sun, Apr 28, 5:20 AM
Unknown Object (File)
Thu, Apr 25, 3:19 AM
Unknown Object (File)
Mon, Apr 15, 12:27 AM
Unknown Object (File)
Thu, Apr 11, 8:51 AM
Unknown Object (File)
Thu, Apr 11, 8:51 AM
Unknown Object (File)
Thu, Apr 11, 5:43 AM
Subscribers

Details

Summary

We don't get partial 2-byte and 3-byte UTF8 characters quite correct, fataling instead of returning false because we access past the end of the string.

Instead, bail early if we run off the end of the string without seeing any issues.

Test Plan

Added and executed unit tests.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped