Click here to Skip to main content
15,894,096 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to import hindi text excel file in mysql database. but when i import excel file in mysql using php script hindi characters are change in english chars and stored in db.
so plz help me how to insert hindi text in database using excel file
Posted
Comments
Zoltán Zörgő 6-Jan-15 11:03am    
1) Do you have xls or xlsx?
2) What library do you use to read those files?
3) Do you use utf-8 allaround your application sources?
4) If you print the text before inserting into db, what do you see?
5) What character set you have used when creating the database?
6) Which library do you use to connect to the database?
7) How do you set up your connection to the database in PHP?
Member 11356307 6-Jan-15 12:08pm    
i have xlsx file
i use PHPExcel library to read excel file
ya i use utf-8 char set
i print the text before inserting db is "i`Foh ds vkUrfjd"
i use utf8_unicode_ci character set for db table
i use codeigniter databse connection api

1 solution

1) Set up Codeigniter for UTF-8 properly: https://philsturgeon.uk/blog/2009/08/UTF-8-support-for-CodeIgniter/[^]
2) Check if the xml in the xlsx file is utf8. You might need to convert encoding with iconv or mb. You can also try detecting the encoding read with mb_detect_encoding[^]
 
Share this answer
 
Comments
Member 11356307 6-Jan-15 15:47pm    
i do every thing as you describe above but i have same problem. i still have output like i`Foh ds vkUrfjd Hkkx esa rki?e forj.k ls lacaf/kr lR; dFku g instead of पृथ्वी के आन्तरिक भाग में तापक्रम वितरण सि संबंधित सत्य कथन है
Zoltán Zörgő 6-Jan-15 15:56pm    
Sorry. If you really did, than i have no future idea without seeing it :(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900