Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a file txt with a lot of names of all nationality, so the problem is with some characters conversion in mysql; for example: the name "Yıldırım", when I import file, I see it like "Y1ld1r1m". For now, to fix this problem, I do some steps:
- import txt file in Access
- export it from Access to csv file
- import csv file in an older version of xampp (in the newest version I see ? character)
- export sql file of table
- import sql file in my online database

In this way the name "Yıldırım" I see like "Yildirim".

But this is very very boring to do every time.

I try a lot of character set but I see "Yıldırım" always like "Y1ld1r1m". Yesterday I try with a new version of xampp and, with some tests, I found utf-16le character set; so, if I set the column with utf-16le and import txt file with LOAD DATA INFILE, I see "Yıldırım" like "Yıldırım".

Very good!!! But my online database (with Aruba) doesn't have utf-16le!! What can I do? Someone has some idea?
Posted
Comments
Shweta N Mishra 4-Feb-15 3:55am    
What is the datatype of your columns in table
Dav04 4-Feb-15 4:05am    
Actually latin1, but I try also other datatype with the same result.
Jörgen Andersson 4-Feb-15 7:35am    
Latin1 is the characterset, datatype would be Varchar, NVarchar or Number etc.
Try to change the datatype, of the column you import the names into, to NVarchar, that should fix it.
Dav04 4-Feb-15 7:46am    
Ah ok... I'm sorry... however, default is varchar, I try also with text but it's the same..... I don't have NVarchar as datatype....
Jörgen Andersson 4-Feb-15 7:56am    
Ok, MySQL specific.
Then you can create the column with a specific characterset:
CREATE TABLE MyTable(
MyColumn VARCHAR(64) CHARACTER SET utf8
);

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