0

Structure of mysql table:

id-----int
name---var-----utf8_persian_ci

after saveing the EXCEL file as a file.csv and importing it from phpmyadmin it's showing the text in database like:

????? ??? ???? 䟪? 㠧?驥

even my mysql formate is in utf8, here when i save the text in csv and if i open csv file in notepad still it's like:

????? ??? ???? 䟪? 㠧?驥

how i can keep it work in utf8, regards in advacen

SAR
  • 1,765
  • 3
  • 18
  • 42
  • problem is not in mysql it's in saveing excel file to csv – SAR Oct 26 '14 at 10:13
  • possible duplicate of [Excel to CSV with UTF8 encoding](http://stackoverflow.com/questions/4221176/excel-to-csv-with-utf8-encoding) – rjdown Oct 26 '14 at 11:21
  • when importing the file the persian text changes to ????? ??? ???? 䟪? 㠧?驥 – SAR Oct 27 '14 at 03:17

1 Answers1

1

For persian excel files on importing it to mysql,

file name = file1.xls

1- the database table columns should support utf8-persian-ci
2- save .xls fiel as **Unicode Text(.txt)**--file1.txt
3- open file1.txt (now replace tab(space) to comma(,)
     you can do it by search and replace just copy the tab(space) and replace with comma(,)
4- after replaceing tab to comma , **save as** file as file1.csv 
   on encodeing--select utf-8


4- open phpmyadmin ,create database ,create table(same column) 
5- chose file1.csv
6- run import 

here you are done. NOTE: the column of your table in database should be same as column in file1.csv

regards

SAR
  • 1,765
  • 3
  • 18
  • 42