utf8mb4

Old utf8 char_set could cause unexpected error like

Incorrect string value: '\xF0\x9F\x98\x8A' for column 'customer_service' at row 1

Here is example string:

麻煩利用粉絲專頁https://www.facebook.com/xnf269/\n私訊喔?

To solve this, change char set settings in config file of CodeIgniter:

$db['default']['char_set'] = 'utf8mb4';
$db['default']['dbcollat'] = 'utf8mb4_unicode_ci';