Recover original data saved as "???????" from mysql database

Viewed 221

While saving the information to the database field the settings were as follows:

character set: latin1
collation: latin1_swedish_ci

Once the users updated the information,i noticed that many information were saved as "?????????????? ??????????????? ???? ?????" (Question marks) to the database. English(language) information were saved without questions marks. All other languages were saved with question marks.

Now i have changed the character set to utf8 and all the languages are saved properly.

The problem is that i need to recover the information which is saved as question marks. eg:"?????????????? ??????????????? ???? ?????"

XAMPP Version: 5.6.19
Navicat version 11.0.17

Database server
Server version: 10.1.10-MariaDB - mariadb.org binary distribution

Web server
Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.19 PHP version: 5.6.19

phpMyAdmin
Version information: 4.5.1

Please help me to get the original data.

5 Answers

you have to select UTF-8_general_ci Encoding in type of collation set.

not latin1_swedish_ci

i think there is a way fetch data from the database via mysqli::query and also use mysqli::set_charset before selecting (maybe you need to try many times with different charset like utf-8,....) then you can have array of original data then change your table and database collation after all save the data.

Related