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, Jan 31, 7:16 AM
Unknown Object (File)
Sat, Jan 25, 8:08 AM
Unknown Object (File)
Mon, Jan 13, 11:14 PM
Unknown Object (File)
Mon, Jan 13, 4:21 AM
Unknown Object (File)
Dec 11 2024, 5:55 PM
Unknown Object (File)
Dec 10 2024, 10:49 AM
Unknown Object (File)
Dec 8 2024, 8:07 AM
Unknown Object (File)
Nov 27 2024, 10:14 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