Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm curious what is considered the standard today for use as the Collation of MySQL Tables?

I was told that Latin-1 was the best choice when I was beginning with MySQL, but came across this post from 2009.

It states that US-ASCII and LATIN-1 Character Sets are on the way out, and that UTF-8 is on the way in and should be made the default by MSQ version 6.

Does this gel with what you know, or with what you think, or with what you do?

For this question, let's assume there is no specific need for non-english characters.

share|improve this question
    
Doesn't it depend on whether you plan to use english-only text or not? –  c0da Sep 22 '11 at 5:54
    
@c0da - I added a caveat to the question. Good point. –  stefmikhail Sep 22 '11 at 6:04
    
Check out asciitable.com If you are satisfied by the 127 ASCII chars, then use it :) Otherwise you can go ahead with UTF-8... –  c0da Sep 22 '11 at 6:12
1  
Migrations to UTF-8 are painful. Unless you know you'll never, ever have a requirement to do it, I'd simply go for UTF-8 now and have one less problem to worry about - assuming your language of preference is fully compliant, of course. –  Bill Michell Sep 22 '11 at 12:12
1  
@stefmikhail - Backwards compatibility. html can explicitly convey the encoding. But on a computer system, many programmers (especially the ones who were writing the code 10 years ago) simply accept the system default encoding, and there are as many of those (incompatible from one another) as stars in the sky. Treating LATIN-1 as UTF-8 will get you in trouble as soon as you stray outside the US-ASCII character range. Here in the UK, for example, £ is the character most people will trip over first. –  Bill Michell Sep 23 '11 at 8:31
show 2 more comments

1 Answer

up vote 3 down vote accepted

UTF-8 is becoming more and more common virtually everywhere, has no storage penalty over US-ASCII for the US-ASCII range (U+0000 through U+007F) (depending on the implementation the BOM may carry a three-byte penalty, but a BOM is only needed if the encoding and/or byte order is not otherwise known, which it would be in this case), and it can represent the full range of Unicode so it will future-proof your application character-set-wise at no extra cost if you don't use that capability. In summary, I see no reason not to use UTF-8 encoding these days, particularly if your choices are between UTF-8 and US-ASCII. And even in a US-only world, I would be very wary of saying that there will be "no need" to encode any letters outside of the English alphabet.

I'm pretty sure I saw a RFC from a few years back that stated that UTF-8 is the new Internet standard character set (replacing US-ASCII), but then I couldn't find it again. Maybe someone knows which one that was and can dig out the number?

share|improve this answer
    
The article I linked to in my question also states that UTF-8 is the new Internet standard, and the article is from 2009. I asked this of Bill Michell as he commented on my question, but why is it that the default for html is UTF-8, while in MySQL it is not? –  stefmikhail Sep 22 '11 at 19:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.