Homec4science

Add phutil_is_utf8_with_only_bmp_characters()

Authored by epriestley <git@epriestley.com> on Feb 24 2014, 01:19.

Description

Add phutil_is_utf8_with_only_bmp_characters()

Summary:
Ref T1191. We currently use utf8 charsets in MySQL, which silently truncate characters outside of the basic multilingual plane (larger than U+FFFF) like "Musical G-Clef".

Add a method to detect that a string contains characters outside of this range, and thus that inserting it will silently truncate data.

Test Plan: Added and executed unit tests.

Reviewers: btrahan, arice

Reviewed By: arice

CC: chad, arice, aran

Maniphest Tasks: T1191

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

Details

Committed
epriestley <git@epriestley.com>Feb 24 2014, 01:19
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU18f7be8100d1: Add AWS Region support to PhutilAWSFuture.
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU0879582275a5: Add phutil_is_utf8_with_only_bmp_characters() (authored by epriestley <git@epriestley.com>).Feb 24 2014, 01:19