0

There is such a text - . It is italic and bold, but has no styles. Everywhere I copy and paste this text, it looks the same. I tried to insert it into the mysql table in utf-8 and utf8mb4 and cp1251 encoding, but it did not work. In the table, the entry looks ???????? ????????????? ????????????????????? ????????????? ????????????? ????????????????? ????????. Tried to use mb_convert_encoding but didn't help. What it is? What is the encoding? How to insert it into a mysql? Thanks.

Upd It's work fine with utf8m4. Problem was at old version Navicat i use. It did not display the encoding correctly/

  • 1
    I don't think styles like italic and bold are represented in character codes. – Barmar Sep 26 '19 at 21:44
  • @barmar . – tadman Sep 26 '19 at 21:47
  • This *must* be `utf8m4` *all the way through* or it won't render correctly. You need to check all of your configuration settings for connection, server, table and so on to make sure they're aligned. – tadman Sep 26 '19 at 21:48
  • Why do you need to carry text formatting into your SQL table? To me, that seems like bad practice. – Russ J Sep 26 '19 at 21:48
  • @RussJ It's not formatting, these are distinct Unicode characters like ➨ or ! There's a whole host of them mostly for mathematical purposes. = "MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL A". – tadman Sep 26 '19 at 21:49
  • Again, why bother with using the italicized versions of those letters in the DB? Why not just use the regular ones? – Russ J Sep 26 '19 at 21:50
  • @RussJ It's because people will do this and if your database garbles it then your database has an encoding problem and will likely trash other characters as well. – tadman Sep 26 '19 at 21:50
  • I use utf8m4 in table and emoji like inserted correctly, but not this text – Thelonius Faron Sep 26 '19 at 21:58
  • try use utf8_general_ci but dont expect to achieve everything. Character encoding is finite, not infinite. – dodzb Sep 27 '19 at 03:23
  • Thanks. It's work fine with utf8m4. Problem was at old version Navicat i use. It did not display the encoding correctly/ – Thelonius Faron Sep 27 '19 at 05:51
  • `` is hex `F09D9996`, so it definitely needs `utf8mb4`, not `utf8`. (The clue is the leading `F0`.) Since you got 4 question marks for each letter, it failed for one of the reasons given in https://stackoverflow.com/questions/38363566/trouble-with-utf-8-characters-what-i-see-is-not-what-i-stored – Rick James Oct 07 '19 at 00:29

1 Answers1

1

Old versions of Navicat have an option for utf8, but not for utf8mb4.

In the encoding options for navicat connections, pick "use mysql encoding", not "utf8".

Ref: PHP/mysql site using utf8mb4 won't retrieve emojis correctly from database, despite utf8mb4 being specified everywhere that I can find to put it

Rick James
  • 135,179
  • 13
  • 127
  • 222