-1

When i upload data from php post forums "हिन्दी" language, changed into "हरिà" in database but looking correct in webpage,

and

when i upload data through phpmyAdmin from csv file "हिन्दी" changed into "???????" in webpage but looking correct in mysql database,

i ran a query,

SHOW VARIABLES LIKE '%char%'

output results:

+------------------------------+-------+--+----+--+----+--+---
|        Variable_name         |        Value                |  
+------------------------------+-------+--+----+--+----+--+---
| character_set_client         |        utf8mb4              |

| character_set_connection     |        utf8mb4              |  
|                              |                             |  
| character_set_database       |        utf8mb4              |  
|                                 
| character_set_filesystem     |        binary               |  
|                              |                             |
| character_set_results        |        utf8mb4              |  
|                              |                             |
| character_set_server         |        latin1               |

| character_set_system         |        utf8                 |
|                         
| character_sets_dir           | /usr/share/mysql/charsets/  |  
|   +------------------------------+-------+--+----+--+----+--

is everything ok?

i have thousands of data, so i don't want to upload from post forums one bye one. how to get correct this, to get expected results?

MySQL version 5.6.37

0

Two different errors "Mojibake" and "Question marks". Both are discussed in https://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored

You have the equivalent of SET NAMES utf8mb4, but that is only one thing. Are the bytes in the csv file really UTF-8? Are the column(s) defined as CHARACTER SET utf8mb4? Does the <form...> indicate utf8 is expected? Etc. (See that link.)

Dump the hex from the table; it should be E0A4B9 E0A4BF E0A4A8 E0A58D E0A4A6 E0A580 for those letters and signs. C3A0 C2A4 ... would indicate "double encoding". I point out the hex because your statement 'changed into "हरिà" in database but looking correct in webpage' could be caused by either Mojibake or double encoding -- depending on whether the coding problem is with inserting or with selecting.

Note: CHARACTER SET utf8 and ut8mb4 are both adequate for Devangari and other Indian languages. It is better to stick with utf8mb4 in case you ever need Emoji or Chinese.

  • bytes in the csv file is UTF-8,columns defined as CHARACTER SET utf8mb4,table defined as CHARACTER SET utf8mb4 – Praveen Yadav Dec 3 '17 at 17:52
  • And the settings for phpmyadmin? – Rick James Dec 3 '17 at 20:02
  • And the <meta ... in the html? – Rick James Dec 3 '17 at 20:03
  • And the hex of the data in the table? – Rick James Dec 3 '17 at 20:03
  • yes i have a meta tag, <meta charset="UTF-8"> in my html, – Praveen Yadav Dec 3 '17 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.