What is the best practice to store utf8 and us-ascii ?
Posted by: eric
Date: March 04, 2006 06:07PM

Hello,

In the MySQL Manual (10.7 Unicode Support) it's written:

<<Tip: To save space with UTF-8, use VARCHAR instead of CHAR. Otherwise, MySQL must reserve three bytes for each character in a CHAR CHARACTER SET utf8 column because that is the maximum possible length. For example, MySQL must reserve 30 bytes for a CHAR(10) CHARACTER SET utf8 column.
>>

I need utf8 to store data in several languages but I have also columns with characters only in us-ascii (for example an alphabetic code on one char or a bank account number with only numeric characters).
If the charset of the database is set in utf8, the columns with the type CHAR will spend too space if their contents is always in us-ascii.

What is the best practice in this case ?

Declare utf8 charset for the entire database and set a fixed charset (latin1) for the columns which contain only alphabetic characters? Or the reverse? Or an other solution?

Thanks for your opinion.
~~~
Eric

Options: ReplyQuote


Subject
Views
Written By
Posted
What is the best practice to store utf8 and us-ascii ?
3077
March 04, 2006 06:07PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.