1. Description of the problem
in the Report development tool Finereport, the MySQL database connection through the data connection encoding conversion to encode the conversion, in the report input to the database input Chinese data, always appear garbled, this How to solve?
2. Solution
2.1 Check the system's default font
For example, looking under Windows c/window/fonts font styles, such as:
If you do not have the above font, Baidu missing font installed itself, after installation, already contains the above font if the problem still occurs, you need to see and modify the MySQL character set.
2.2 See and modify MySQL character set
· View MySQL character set
MySQL Character set description: MySQL Character set support (Character set supports) has two aspects: Character set (Character set) and Sort method (Collation).
Support for character sets is refined to four levels: server, database, data table (table), connection (connection).
View the default character set (by default, MySQL's character set is Latin1 (iso_8859_1)
In general, the settings for viewing the character set and ordering of the system can be implemented by the following two commands:
1. SHOW VARIABLES like ' character% '; // view character sets , such as:
1. SHOW VARIABLES like ' collation_% '; // View sorting methods , such as:
· modifying the MySQL character set
Method One:
Modify the character set key values in the MySQL My.ini file.
1. default-character-set = UTF8
2. Character_set_server = UTF8
After the modification, restart the MySQL services, service MySQL restart, using
1. mysql> SHOW VARIABLES like ' character% ';
View, the discovery database code has changed to UTF8.
Method Two:
Using SQL commands
1. SET character_set_client = UTF8;
2. SET character_set_connection = UTF8;
Note: Character_set_connection,database,results,server these four characters are identical, it can not garbled. The above method to modify the character set is under the Windows system, if it is a Linux system, using Linux under the same method, the same idea.
After the modification is complete, use the
1. Show variables like ' character_set_% '
Look at the character encoding, and if the problem is garbled after you finish modifying it. You need to define the number of data connections modifications in the designer.
2.3 Data Connection Modification
Add parameters where you define a data connection to add URLs
1. Useunicode=true&characterencoding=utf-8 , not by defining the encoding conversion under the Data Connection window The settings are as follows:
MySQL database connection code conversion invalidation solution in report development tool