mysql - myrocks (mariadb + rocksdb) php charset -


there plenty of posts choosing right charset mysql, it's again different (and frustrating) story rocksdb engine.

firstly, decided use utf8-binary charset (latin1, utf8-bin , binary supported myrocks) because data may contain special chars , want on save side.

furthermore, using php , pdo loading data mysql , connection looks this:

$pdo = new pdo('mysql:host=localhost;dbname=dbname;charset=utf8', 'user', 'password'); 

so set charset utf8 (i tried use utf8_bin, not supported pdo). although, able insert rows, errors following one:

incorrect string value: '\xf0\x9f\x87\xa8\xf0\x9f...' column 'column_name'

but what's error now? hex sequence encodes unicode-smily (a regional indicator symbol letter c + regional indicator symbol letter n). seems me valid utf8 , mysql php configured use it.

you gotta have utf8mb4, not mysql's subset utf8.

🇨 needs 4-byte utf-8 encoding, hex f09f87a8.

if rocksdb not support it, abandon either such characters, or rocksdb. change charset in pdo call, , on columns need it.


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -