在MySQL DB中存储标签和URL的最佳字符集和排序规则 [英] best character set and collation for storing Tags, and URLs in MySQL DB
问题描述
我正在从Flickr中将照片信息检索到我的网站中. 对于每张照片,URL,标题和标签都保存在MySQL数据库中.
I'm retrieving photos info from Flickr into my site. For each photo, the URL, title, and tags are saved in MySQL database.
我读了很多关于最适合这些值的字符集的资料,我发现它主要在使用utf8或latin1之间.
I read a lot about the most suited character set for such values and I found its mostly between using utf8 or latin1.
某些标题和标签包含诸如版权(或类似名称)之类的符号. 我可以接受Latin1字符集吗?
Some titles and tags include symbols like the copyright (or similar ones). Will I be OK with Latin1 character set?
推荐答案
从不如果存储的文本为100%ascii,则在数据库中使用utf-8 .如果对文本进行索引,则使用utf-8膨胀每个字符可能会显着降低性能.
Never use utf-8 in your database if the stored text is 100% ascii. Bloating each character with utf-8 could imply a significant performance hit if the text is indexed.
这篇关于在MySQL DB中存储标签和URL的最佳字符集和排序规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!