Replace foreign characters

后端 未结 4 1118
时光说笑
时光说笑 2021-01-04 23:59

I need to be able to replace some common foreign characters with English equivalents before I store values into my db.

For example: æ replace with <

4条回答
  •  花落未央
    2021-01-05 00:41

    Excuse me second-guessing why you're doing this, but..

    If this is for search matching: The point of character set collation in a MySQL (for example), is that you can search for "n" and still match "ñ"

    IF this is for display purposes: I'd recommend if you have to do this, you do it when you display the text to a user. You can never get your original data back otherwise.

提交回复
热议问题