in reply to Encoding of emoji character

The string "Test 😀" is read from a MySQL database table which has encoding latin1.
IMO that's the (or at least one) source of the problem. Latin1 has no code point for 😀…

besides that, Anonymous Monk's reply seems to be spot on.