Skip to main content

Posts

Showing posts from 2023

Character encoding issues in MySQL

Modern databases are ubiquitous, they're used everywhere by applications and scripts, many of which you may have to interact with if you're working in the IT world. Creating a new database and table, then storing data that you can then retrieve later on, seems like a fairly straightforward process. But databases have a lot of settings, and there's a reason corporations hire well trained DBAs to maintain these databases. There are pitfalls you may need to watch for, one of the more common ones being character encoding issues. If you use MySQL or MariaDB as a database, and if you ever ran into the following error, then this may be the post you've been waiting for: Incorrect string value: '\xF0\x9F\x98\xF0' for column 'title' at row 1 What this basically says is that the data you're trying to store in the database doesn't fit with the encoding available. The data may be some type of binary, or maybe just text in another language that requires more l