This should replace surrogate characters with a replacementCharacter (that could even be string.Empty) This is a MySql problem, given the utf8mb4. Here there is the difference between utf8 and utf8mb4 in MySql. The difference is that utf8 doesn't support 4 byte utf8 sequences. By looking at the wiki, 4 byte...
php,utf-8,character-encoding,decode,utf8mb4
Adding accept-charset="ISO-8859-1" to form element solved the problem. OUTPUT array (size=1) 'keywords' => string 'Ç, Ğ, İ, Ö, Ş, Ü, ç, ğ, ı, ö, ş, ü' (length=64) Ç, Ğ, İ, Ö, Ş, Ü, ç, ğ, ı, ö, ş, ü ?, Ğ, İ, ?, Ş, ?, ?, ğ, ı, ?, ş,...
php,mysql,utf-8,character-encoding,utf8mb4
Some facts: many emoji are above the BMP (basic multilingual plane) in Unicode, i.e. above code point U+FFFF MySQL's utf8 charset can only represent the BMP, it is not actually full UTF-8 (yay MySQL) for full Unicode support MySQL has utf8mb4 there should be no actual error when trying to...
mysql,encoding,utf-8,character-encoding,utf8mb4
Documentation: The character set named utf8 uses a maximum of three bytes per character and contains only BMP characters. As of MySQL 5.5.3, the utf8mb4 character set uses a maximum of four bytes per character supports supplemental characters: For a BMP character, utf8 and utf8mb4 have identical storage characteristics: same...
Your connection is set up for utf8; it needs to be set up for utf8mb4. How did you set it? Change to whichever of these applies. SET NAMES utf8mb4 PDO(... charset=utf8mb4) mysqli::set_charset('utf8mb4') etc Emoji are 4-byte utf8 codes, hence the four question marks....
What MySQL calls utf8 is a limited subset of UTF-8 which allows only three bytes per character and covers code points up to 0xFFFF. Even utf8mb4 doesn't cover the full UTF-8 range, which supports encoded characters up to 6 bytes long The consequence is that any data from either a...
Going the other way (from utf8mb4 to utf8) - According to mysql`s manual the risk is if your fields contain 'supplementary' characters. Otherwise they should be identical. Looks like there should be no risks going the way you intend.
mysql,utf-8,character-encoding,mysql-5.6,utf8mb4
The client usually sets these values when connecting. The settings in my.ini are merely defaults which apply when the client does not explicitly specify a connection encoding. Since they're unreliable, every client should specify a connection encoding. Since you've got some fancy screenshot there I'll guess that you're connecting with...