I recently changed hosting companies and migrated whm and cpanel to new host. Moved into new server using the WHM cpanel transfer tool.
Immediately noticed some character encoding issues, and manually fixed a bunch of then in mysql. These issues were not really recognizable in mysql phpmyadmin but were noticable on webpages as black diamonds with a ? inside them. We continue to see encoding issues, some of which is people cutting and pasting from word, (no matter how much I ask them not to do that). I have also noticed that user input from ipads via an in-house app I developed which posts data to the server will cause different character encoding issues. All my mysql tables are set to utf8_unicode_ci
Example, On ipad I type in
Desc _. - “. ‘ now
and in mmsql I see this
Desc _. - “. ‘ now
On webpage it looks ok but it causes display issues in certain places like PDF generator.
Is it a Mac thing? An Xcode thing? How can I correct this before adding or updating record with php / mysql?
It is quite OK to INSERT
utf8 characters, but you must tell the connection that the client is using UTF-8
. That is the main reason for getting Mojibake like “
and ‘
.
Yes it would probably be good to change the entire database, not just to utf8, but utf8mb4. How to convert an entire MySQL database characterset and collation to UTF-8? discusses such.
This discusses the causes for M9jibake: Trouble with UTF-8 characters; what I see is not what I stored