1

I have a table filled with names and surnames of users from a country called Croatia. Now their names contain symbols such as ščćžđ. Now I wish to create a username based on their names and surnames(first letter of name concatenated with the surname) and I don't want those characters in their usernames so I want to change all these characters to their "normal" counterparts. Basically I wish to change ščćžđ in names/surnames to scczd. Is there any way I can do this in MySQL?

MrPlow
  • 1,295
  • 3
  • 26
  • 45
  • http://stackoverflow.com/q/4813620/139010 http://stackoverflow.com/q/2753422/139010 – Matt Ball May 24 '13 at 16:13
  • Can you explain _why_ you don't want those characters in their username? (Note: `CONVERT (field USING ascii)` does not help apparently.... `iconv` would do it, but not in `mysql` afaik) – Wrikken May 24 '13 at 19:29
  • @MattBall I thought I've searched quite thouroughly, but I guess I haven't. Thanks! – MrPlow May 24 '13 at 20:03
  • @Wrikken Well for now there's no particular reason. I just thought that it would help me later if for some reason I'd have to use applications which don't support other encodings. – MrPlow May 24 '13 at 20:06
  • If that's a serious consideration it would be valid indeed. I personally don't know any way to do it in MySQL, but the `iconv` remark is valid (it would convert it just fine on application level), but if you broaden your customer base, there comes a time when some asian glyphs for instance just don't have an ascii counterpart, which is why I asked, because in that instance it wouldn't be the way to go. – Wrikken May 25 '13 at 00:37

0 Answers0