HomePhabricator

Add phutil_is_utf8_with_only_bmp_characters()

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

Provenance
epriestleyAuthored on
epriestleyPushed on Feb 24 2014, 12:19 AM
Reviewer
arice
Differential Revision
D8310: Add phutil_is_utf8_with_only_bmp_characters()
Parents
rPHU18f7be8100d1: Add AWS Region support to PhutilAWSFuture.
Branches
Unknown
Tags
Unknown
Tasks
T1191: Comments are truncated at first non-base-plane character

Event Timeline