During the soft launch of Free Pee 2, I ran into a weird problem. Bathrooms that had Chinese descriptions wouldn't show up. Immediately, I thought of character encodings and database collation - but it didn't feel right because everything worked correctly in the original Free Pee app. Why did it suddenly stop working?
After lots of Google searches and Stack Overflow answers, I added
$db->set_charset("utf8") to my
mysqli object. It turned out that didn't solve the problem either. Finally, after almost giving up hope, I decided to re-save all my app files as UTF-8 (even though they've never been anything but UTF-8). To my surprise, that worked. I shrugged and moved on.