[sql] - Unicode/UTF-8 and MySQL database - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Nico-D
Posts: 63
Joined: Mon Aug 18, 2008 2:34 pm

[sql] - Unicode/UTF-8 and MySQL database

Hello,

I am using AI 6.6 and I installed MySQL ODBC Connector 5.1 on a Windows XP Pro SP3 (English Version, English-US is used for non-Unicode programs). Running chcp from a command prompt gives Active code page: 437.

In a multilingual (English/French) package, I am including an UTF-8 SQL script (UTF-8 file and content) that connect to a local MySQL database using the ODBC Connector, and creates the database. The DB is created, but the accented characters are bad. A typical UTF-8 bad interpretation problem.

The database creation specifies to use UTF-8:

Code: Select all

CREATE DATABASE IF NOT EXISTS myowndb DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
I think my problem is related to this open ticket:

http://www.advancedinstaller.com/forums ... f=2&t=7741

for the following reasons:
* using MSI to create the DB leads to an incorrect result for accented characters ("Numéro"),
* using in-line command (mysql.exe -u root -p < create_script.sql) leads to a correct result ("Numéro").

There is a strange thing while testing your proposition in the thread 7741:
... when Windows Installer runs the script, it uses the codepage of the language of the installation ...
Making an install in French OR in English leads to the same result: incorrect characters. :(

What is your opinion?

Best regards,
-- Nicolas D.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: [sql] - Unicode/UTF-8 and MySQL database

Hi Nicolas,

I'm not sure why you are encountering this behavior. The problem with the languages was resolved in the 6.5 version, so the SQL Script should use correct characters for any language. Can you please send us a small test case to support at advancedinstaller dot com so we can investigate it? The test case should contain a simple AIP which uses an SQL Script that shows this problem.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Nico-D
Posts: 63
Joined: Mon Aug 18, 2008 2:34 pm

Re: [sql] - Unicode/UTF-8 and MySQL database

Hi Cosmin,

Sorry for the delay, but I have just sent you an email containing a simple AIP file which reproduces the detailed problem.

Regards,
-- Nicolas D.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: [sql] - Unicode/UTF-8 and MySQL database

Hi Nicolas,

Please note that the SQL Script file needs to be encoded as UTF8 with BOM in order to be used as an Unicode script. Let me know if the problem persists when using this encoding (you are currently using ANSI as UTF8).

We will mention this in the help for future versions of Advanced Installer. Thank you.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”