Questions tagged [utf8mb4]

Unlike its `utf8` encoding, MySQL’s `utf8mb4` encoding offers full Unicode support (including four-byte UTF-8-encoded symbols).

Unlike its utf8 encoding, MySQL’s utf8mb4 encoding offers full Unicode support (including four-byte UTF-8-encoded symbols).

The utf8mb4 character set is useful because nowadays we need support for storing not only language characters but also symbols, newly introduced emojis, and so on.

utf8mb4 has been available since MySQL 5.5.3 (released March 2010).

A nice read on How to support full Unicode in MySQL databases by Mathias Bynens can also shed some light on this.

More information about the utf8mb4 character set may be found on the official MySQL Documentation.

398 questions
3
votes
2 answers

Why doesn't ruby detect an invalid encoding while mysql does?

I'm pulling some RSS feeds in from YouTube which have invalid UTF8. I can create a similar ruby string using bad_utf8 = "\u{61B36}" bad_utf8.encoding # => # bad_utf8.valid_encoding? # => true Ruby thinks this is a valid UTF-8…
johnf
  • 380
  • 1
  • 4
  • 10
3
votes
1 answer

execute failed: Incorrect string value: '\xD6sterl...' with mariadb and perl DBD

I'm a novice perl programmer trying to use DBI to write a buffer of text that contains an email with umlauts and other non-ASCII characters to a joomla database and having a problem. DBD::mysql::st execute failed: Incorrect string value:…
Alex Regan
  • 477
  • 5
  • 16
3
votes
3 answers

Black diamonds and question marks persisting after setting database uft8mb4

Regarding MySQL database and Java JDBC connection encoding. Database has been converted to utf8mb4 and utf8mb4_unicode_ci as shown this is the results of SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';…
3
votes
1 answer

How can I fix "1366 Incorrect string value: '\xE5'

I checked other topics and changed my database to this "utf8mb4_general_ci" and also I am trying to insert data with laravel thats why I changed laravel Mysql Database config to this; 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_general_ci', but…
firefly
  • 876
  • 2
  • 15
  • 42
3
votes
3 answers

UTF-8 encoding problem while importing a sql file

I have a server hosting MySQL, PHPMyAdmin reports: Server version: 5.1.56-community MySQL charset: UTF-8 Unicode (utf8) I export a sql from using either mysqldump -uroot -p database > file.dump or mysqldump -uroot -p database -r file.dump (both…
jpo38
  • 20,821
  • 10
  • 70
  • 151
3
votes
1 answer

convert a json column to utf8mb4

in a mysql insert request i used ($text being sent by $_POST and column MESSAGE being of JSON format) : $data = '{"mytext":".'$text'."}'; INSERT INTO xxxxx (MESSAGE) VALUES('$mytext'); i was stuck with the following problem : Some smiley are…
Bloob
  • 41
  • 1
  • 4
3
votes
2 answers

Getting duplicate entry errors when converting utf-8 database to utf8mb4

I'm trying to convert a database to use utf8mb4 instead of utf8. Everything is going fine except one table: CREATE TABLE `search_terms` ( `id` int(11) NOT NULL AUTO_INCREMENT, `search_term` varchar(128) NOT NULL, `time_added` timestamp NULL…
John Mellor
  • 2,351
  • 8
  • 45
  • 79
3
votes
1 answer

Can I safely use utf8 tables and columns in utf8mb4 mysql database?

I want at least some columns in my database to use utf8mb4 because they have to store text that includes emoji. I've been testing some stuff locally for a fairly large project and I've followed the steps in this guide…
PaulSpr
  • 85
  • 1
  • 5
3
votes
1 answer

Mysql convert table, collation not changing

I'm using mariadb (" 10.1.20-MariaDB-1~trusty") with utf8mb4. Now I'm in the process of converting all tables to "row_format = dynamic" and table collation "utf8mb4_unicode_ci". I've noticed that there are some rogue tables in my database that still…
Kotwarrior
  • 108
  • 4
3
votes
2 answers

Golang MySQL 1366 incorrect string value error

I am inserting strings into my database but getting the MySQL 1366 error for invalid string byte sequences. 2016/11/04 13:33:40 Error 1366: Incorrect string value: '\x89PNG\x0D\x0A...' for column 'text' at row 1 2016/11/04 13:33:56 Error 1366:…
Xeoncross
  • 55,620
  • 80
  • 262
  • 364
3
votes
1 answer

MySQL Database stores question marks instead of special characters

I am trying to displaying VERY Special Characters (like ) inside of my website, and storing it into my database. When I write special characters like those, they get once displayed, but when I reload the page and the server gets the string from…
Simone Romano
  • 165
  • 3
  • 10
3
votes
3 answers

Why is my table's encoding wrong?

I'm using Rails 5 and MySQL 5.7. I have the following in my database.yml: default: &default adapter: mysql2 pool: 5 encoding: utf8mb4 charset: utf8mb4 collation: utf8mb4_unicode_ci socket: /tmp/mysql.sock development: <<: *default …
nc.
  • 7,179
  • 5
  • 28
  • 38
3
votes
2 answers

Doctrine is converting string to hex value

I am converting one database to another database through a script. While running the script I am getting the following error: SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xBFbangl...' for column 'country' at row 1 An exception…
xfscrypt
  • 16
  • 5
  • 28
  • 59
3
votes
1 answer

JOOQ emoji (utf8mb4) support

We try to store and read emoji in our MySQL 5.6 database with JOOQ. The database, table and column are using character set utf8mb4 and collation utf8mb4_unicode_ci. With MySQL Workbench I can create and select emojis. So the database should be…
user1482309
  • 289
  • 3
  • 16
3
votes
1 answer

MySQL warning: Incorrect string value: '\x96

I'm trying to import a CVS file where I get this warning: 1366 Incorrect string value: '\x96 PART...' for column I read somewhere that this is about the 4-bit utf8 characters. But changing the collation of the table and column into utf8mb4 didn't…
Iraj
  • 41
  • 1
  • 4