[OpenSIPS-Users] Why is UTF-8 forbidden in the MySQL database?

Jacek Konieczny jajcus at jajcus.net
Fri May 11 10:12:36 CEST 2012


Hello,

I have seen this topic discussed already, but with no definitive answer
or reasonable argument for keeping it as it is.

http://lists.opensips.org/pipermail/users/2009-March/004107.html
http://lists.opensips.org/pipermail/users/2010-September/014723.html

opensipsctl will refuse to use UTF-8 charset in the database, although
SIP is UTF-8 based and this is a natural choice. This is not a problem
as long as MySQL ignores actual data encoding and no other application
is sharing the same database, but I am trying to add a Django-base web
UI to our SIP proxy and Django, like any other modern framework is
encoding-aware and use Unicode internally. I can probably make it work
with the data in OpenSIPS table, but still this looks like waiting for a
de aster -- OpenSIPS stores UTF-8 strings (as they appear in the SIP
requests) in a 'latin1' tables without any conversion. If anything else
tries to convert this from the declared latin1 to Unicode problems will
appear.

The 'latin1' is transparent is not an answer. For storing opaque binary
data there are binary data types. For storing UTF-8 strings there is the
UTF-8 encoding.

Now the questions: are there known problems to be expected if I switch
the database encoding to the proper 'utf8'?
Does OpenSIPS ever do any encoding transformation (to put 'latin1' data to the database)?
Can I expect all the strings in the database are UTF-8 if they came
UTF-8 in SIP request or could they have been truncated or in other way
destroyed by OpenSIPS?

Greets,
        Jacek



More information about the Users mailing list