I am using a utf8 charset mysql tables in a mysql 5.1 server, which does not support utf8mb4 encoding in tables. When inserting 4-byte encoded utf8 characters like "𡃁","𨋢","𠵱","𥄫","𠽌","唧","𠱁". The table will popup error or skip the following texts.
How can I programmatically detect 4-byte encoded utf8 characters in PHP and replace them?
strlen($char) == 4. Not sure if this is really the correct way to detect the characters MySQL can't handle though, going by code point may be more accurate.