0

MySQL 5.7.37-0ubuntu0.18.04.1

The string containing turkish symbols /* sayfa başlığı */ not saving to the column

body longtext CHARACTER SET utf8mb4 NOT NULL,

Column remains empty when other columns of the same INSERT have data. No error displayed (PHP, error reporting enabled).

The problem string was recieved as css file with encoding text/css without charset and Opera browser displays it correctly. The attempt to serve this css with text/css;charset=UTF-8 outputs wrong symbols.

Is any possibility to suppress wrong symbols to save the string? I don't like base64- or other encoding since I'd like to edit field in Adminer/phpMyAdmin?

$db->set_charset('utf8mb4', 'utf8mb4_unicode_520_ci');

was issued and there are no problems with Unicode strings.

zzmaster
  • 318
  • 1
  • 5
  • 16
  • How are you writing the data? Does the driver being used throw errors? Is the driver being used with error reporting enabled? – user3783243 May 31 '22 at 16:06
  • I use ZebraDatabase (You can goole it) and another errors are displayed – zzmaster May 31 '22 at 16:17
  • Is `another errors are displayed` a typo? If not please provide errors, if so have you used the error reporting for Zebra, https://stefangabos.github.io/Zebra_Database/Zebra_Database/Zebra_Database.html#methoderror? It would improve the question if you added the code. – user3783243 May 31 '22 at 16:22
  • 1
    None of [those characters](https://apps.timwhitlock.info/unicode/inspect?s=sayfa+ba%C5%9Fl%C4%B1%C4%9F%C4%B1) require more than 2 bytes so even good old 3-byte `utf8` should suffice. You're probably failing to use UTF-8 in some step of your workflow and don't have a SQL mode that handles that as error. – Álvaro González May 31 '22 at 16:47
  • https://stackoverflow.com/questions/279170/utf-8-all-the-way-through – Sammitch May 31 '22 at 18:06
  • user3783243 I meant that if I make an error it would be displayed. Like "Incorrect datetime value: 'qwerty' for column 'updated_at' at row 1"; $db->error() is empty after insertion – zzmaster May 31 '22 at 18:18
  • "wrong symbols" --Let's see the symbols, it may give a useful clue. Also, can you dump the source in hex? – Rick James Jun 01 '22 at 03:00
  • Based on the "wrong symbols", this may provide an answer: https://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James Jun 02 '22 at 18:17

0 Answers0