It often happens that characters such as é gets transformed to é, even though the collation for the MySQL DB, table and field is set to utf8_general_ci. T
Regardless of the language it's written in, if you were to create an app that allows a wide array of encodings, handle it in pieces: