Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
711 views
in Technique[技术] by (71.8m points)

sql - Allow non ascii characters in MySQL database

Recently a record was inserted into my mysql database containing russian letters. The database couldn't display them properly. Is there anything I can do to allow diversity of languages on my website?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

you should take a look at utf8 encoding

can you please post what encoding is beeing used by your database, and your table? (can you post structure of your db?)

EDIT: To answer you question in your comment, basic difference is that utf8_general_ci is faster but doesn't care about some language specific comparisons. You can read more on this in the link I submitted above in my post. In fact it affects behaviour of sorting and searching.

It does matter how would you like your database to behave, all of these collations are useful in different environments. In your case I would not use utf8_bin since it only compares strings using it's binary values.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...