UTF-8, characterEncoding property error.

Contains tips for configurators working with Aware IM
Post Reply
RLJB
Posts: 914
Joined: Tue Jan 05, 2010 10:16 am
Location: Sydney, Australia

UTF-8, characterEncoding property error.

Post by RLJB »

We are trying to make a multi-lingual app that accepts Chinese characters.

Our MYSQL database is set to:

'MySQL charset: UTF-8 Unicode (utf8)

Our MYSQL Connection Collation is set to: utf8_unicode_ci

But when Aware creates new tables it is using collation latin1_swedish_ci which we think is the default.

We tried to change the my.cnf config file to utf-8, and have restarted mysql and Aware, however we get the following error in Aware on startup.

"AwareIM was unable to create or locate the database it requires.
Error message returned by database is:
Unable to create database BASDB unknown initial character set index '192' received from server. Initial client character set can be forced via the 'characterEncoding' property."

Can anyone advise how to fix?

Do we need to convert ALL existing tables in BASDBTEST & BASDB to the same collation for Aware to work?

Thanks.
Rod. Aware 8.6 (latest build), Developer Edition, on OS Linux (Ubuntu) using GUI hosted on AWS EC2, MYSQL on AWS RDS
RLJB
Posts: 914
Joined: Tue Jan 05, 2010 10:16 am
Location: Sydney, Australia

Post by RLJB »

Ok - we fixed the Aware error by Altering all tables in MYSQL to use database collation: utf8_general_ci and character set utf8 - this means that Aware now restarts and runs ok and we can store Chinese characters in our DB.

BUT....

When we put in Chinese characters through an Aware form it changes the characters eg:

When we type 客户端 it gets changed to 客户端 when the form is saved.

If we just push the Chinese characters into the database directly they store in the DB correctly and they display in Aware forms fine, but if we just save the form it will change the characters to symbols above.
Rod. Aware 8.6 (latest build), Developer Edition, on OS Linux (Ubuntu) using GUI hosted on AWS EC2, MYSQL on AWS RDS
aware_support
Posts: 7526
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

I think there were some fixes in this area recently, so you may need to update to the latest build
Aware IM Support Team
RLJB
Posts: 914
Joined: Tue Jan 05, 2010 10:16 am
Location: Sydney, Australia

Post by RLJB »

We just upgraded to 1372 and still have the same issue.

Should we buy a support ticket?
Rod. Aware 8.6 (latest build), Developer Edition, on OS Linux (Ubuntu) using GUI hosted on AWS EC2, MYSQL on AWS RDS
aware_support
Posts: 7526
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Before you do this can you try it on a Windows system (just install an evaluation version somewhere)?
Aware IM Support Team
RLJB
Posts: 914
Joined: Tue Jan 05, 2010 10:16 am
Location: Sydney, Australia

Post by RLJB »

ok, we have fixed this.

First, let me say our error had nothing to do with Aware - Aware is doing everything great.

Others might get this problem though, so here is the fix.

- when MYSQL installs the DEFAULT character set and DB collation is latin1 and latin_swedish_ci

- this character set will not accept chinese/japanese characters, you need utf8 - unicode (of which there are a few versions - find the one that suits your need)

- MYSQL sets the collation at DB, Table and Field level so you need to keep this in mind too

- when Aware creates a BO/attribute it will use the default character set of the DB - thus most of us are probably using latin1

- so you need to change this (Google how to do this, it's a bit of a mission, especially if you then want to actually change the data that already exists in the DB), the one important tip we found was to use a good DB tool to alter Table collation such as Navicat, or the free Heidi SQL - this allows you to change multiple tables collation at once rather than use command line for each table (we have about 800 tables in our BASDBTEST DB)

- you also need to set the collation in the my.cnf file so when mysql restarts it will continue to use your unicode collation

Good luck!
Rod. Aware 8.6 (latest build), Developer Edition, on OS Linux (Ubuntu) using GUI hosted on AWS EC2, MYSQL on AWS RDS
Post Reply