Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350699

Summary: Unicode characters saved in mysql is not properly displayed in BIRT reports
Product: z_Archived Reporter: Spirit Being <daemonstasis>
Component: BIRTAssignee: pshi <pshi>
Status: RESOLVED INVALID QA Contact: Xiaoying Gu <bluesoldier>
Severity: critical    
Priority: P3 CC: bluesoldier, mwu, pshi
Version: unspecified   
Target Milestone: 3.7.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Spirit Being CLA 2011-06-29 08:30:09 EDT
Build Identifier: 20110218-0911

Unicode characters like • - alt+7 - is converted to • if inserted to mysql using an HTML form submit. When BIRT retrieves the saved data from the mysql source, the bullet • will be shown as • in the reports which is incorrect.

Instead of seeing • i can see •. If the • is queried using a PDO and display it to HTML, it is correct(•). But if I use BIRT Designer to retrieve the • from the mysql database, it is not displayed correctly(•).

Reproducible: Always

Steps to Reproduce:
1. Create a simple database and table in mysql to save a word or string
2. Create a HTML form with a textarea. Put it inside a form and submit it to PHP.
3. Enter Unicode characters like alt+7 = • , alt+8 = ◘ etc.
4. Let PHP insert the word or string into mysql using PDO.
5. View the word or string from mysql client like sqlyog or workbench.
6. Notice that the strings are converted to • for • etc
7. Retrieve the string or word using PDO in php and display it to HTML, notice that it displayed the characters properly • ◘.
8. Create a birt report in eclipse birt designer to retrieve the characters from
the mysql database.
9. Notice that birt report displays the • as •.

****How to fix this so that unicode characters will be shown properly in birt reports.
Comment 1 pshi CLA 2011-07-07 01:57:10 EDT
The data you insert into database is not correct, the BIRT will show the result as the database shows. The html shows the correct words, I think it is just a coincidence, maybe it uses the same encoding as you use in php.
The data in the database should be the same as you write in php. I think you can add code "PDO.exec("SET NAMES 'GBK'")" or "PDO.exec("SET NAMES 'utf8'")" in your php code before you execute the database operation. Just have a try and it is also related to the encoding in mysql.
Comment 2 pshi CLA 2011-07-07 02:26:41 EDT
update the status