Skip to content

Converting a Mysql table into a “proper” Turkish XML file

by dkberktas on September 3rd, 2009

Character sets, encoding, decoding, anything related to non-English characters make me feel uncomfortable, since at each time I have problem related to these things, I spend hours just to see a proper Turkish character like “ç”.

tagaroo suggests this image is appropriate for the post

This was again the case with an old mysql table with encoding utf8_general_ci. Before there was UTF-16 then UTF-8 now I have deal with the subleties of utf8_general_ci (which is in fact has other types like utf8_unicode_ci).

Anyway, after spending hours just to see the correct characters in the console, very near to the point I gave up, I found a link that suggest to just replace the unwanted characters like “ç” to ç. here is the complete list that I use in Java,  but be careful about the order you replaced:

textVal = textVal.replace("ÄŸ","ğ");
textVal = textVal.replace("ı","ı");
textVal = textVal.replace("İ","İ");
textVal = textVal.replace("Ä","Ğ");

textVal = textVal.replace("Ü","Ü");
textVal = textVal.replace("ü","ü");
textVal = textVal.replace("Ç","Ç");
textVal = textVal.replace("ç","ç");
textVal = textVal.replace("Ö","Ö");
textVal = textVal.replace("ö","ö");
textVal = textVal.replace("ÅŸ","ş");
textVal = textVal.replace("Å","Ş");

Yeap, that solved my problem, thanks to you guys at the forum. But, I still doesn’t understand why we still need to have that number of encoding!

Ş

From → Uncategorized

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS