Using UTF-8 encoding
2010-04-21
QueueMetrics is a fully internationalized application: that is, it handles all
user transaction with UTF-8 encodig, and therefore can display and accept any
character for any language.
Unfortunately, MySQL does not natively use UTF-8 encoding for its tables and
will try to use the "current encoding" whenever possible. So you may notice
that if you e.g. enter an agent's name using not-Latin characters, when you
read it back from disk it appears all garbled or a series of ??? signs.
To make QM fully able to process UTF-8 strings, you should follow the steps
detailed here:
1. Run the following commands on all tables of the database but the queue_log table:
ALTER TABLE `agaw_alarms` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `agaw_dati` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `agaw_logs` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `agaw_runs` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `agenti_noti` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `arch_classes` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `arch_syslog` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `arch_users` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `broadcast_msg` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `call_status` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `code_possibili` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `dbversion` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `locations` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `oq_calls` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `oq_notes` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `oq_queues` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `pause_codes` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `qa_data` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `qa_forms` CONVERT TO CHARACTER SET utf8;
ALTER TABLE `qa_forms_items` CONVERT TO CHARACTER SET utf8;
If your system has other tables, please do the conversion on ALL tables.
2. Open the QueueMetrics web.xml and modify the connection string adding, before
the </param-value> tag, the string:
&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
After this modification you should have something that looks like:
<param-value>jdbc:mysql://127.0.0.1/queuemetrics?zeroDateTimeBehavior=convertToNull
&jdbcCompliantTruncation=false&user=queuemetrics&password=javadude
&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8</param-value>
It must all be written on a single line.
3. Then download the latest MySQL java connector binary package you can find at the link:
http://dev.mysql.com/downloads/connector/j/5.1.html
Extract the mysql-connector-java-5.1.7-bin.jar file and copy it on your
QueueMetrics box, placing in the folder /usr/share/java.
Replace the symbolic link you can find in
/usr/local/queuemetrics/webapps/queuemetrics-1.x.x/WEB-INF/lib in order
to have it pointing to new connector.
4. Restart the QueueMetrics service issuing a /etc/init.d/queuemetrics restart
This will enable UTF8 support.
Permalink - Back to FAQs