[OpenSIPS-Users] UTF8 in MySQL database

Phil Vandry vandry at TZoNE.ORG
Tue Mar 31 16:41:19 CEST 2009


(Sorry, I digress to MySQL issues not related to OpenSIPS. Future
 replies will be off-list.)

On Tue, Mar 31, 2009 at 11:44:42AM +0300, Bogdan-Andrei Iancu wrote:
> So, more or less it is about the table size - what is not clear for me 

Yes -- but only if you are using a fixed record format. Usually a
variable length record format is used and then the data takes up only
the space it needs (as little as one byte per character if it's all
ASCII). In particular, the Mysql schemas included in the OpenSIPS
distribution all use a variable length record format.

> (from what you say) is why for a char(n) you need n bytes when using  
> latin1 charset? it means it supports only 256 chars? because according 
> to mysql docs, the latin1 supports a lot of non-standard chars (extended 
> codes).

Normally latin1 means the same as ISO-8859-1 (and that is what I had
always assumed). But according to this:

http://dev.mysql.com/doc/refman/5.0/en/charset-we-sets.html

Mysql's latin1 is actually something called "cp1252" which I am not
familiar with, not ISO-8859-1. It goes on to say that "cp1252" is a
superset of ISO-8859-1. Is this what you mean by non-standard chars?
But it appears that "cp1252" is still a single-byte character set,
just like ISO-8859-1 (and all ISO-8859-x), so it can only support 256
characters and only requires one byte per character to encode.

-Phil



More information about the Users mailing list