When building a website under linux, the garbled problem has plagued me for almost a week, and finally solved it.
My experience is that the application must match the character set (encoding) of the database.
Specifically, if you want to use gb2312 encoding, you must ensure that each jsp file is stored in gb2312 encoding (you can select gb2312 encoding when saving the file), The file header should also be defined; for the database, the code should be defined when creating the database, for example: create database mysql default character set gb2312 collate gb2312_chinese_ci; the last thing to do is to add the following code to the relevant file when connecting the data:
useUnicode=true&characterEncoding=gb2312.
To add to the explanation, in linux, in fact, do not choose gb2312, I use utf8, of course, you need to follow the above steps to set up, certainly not garbled! Personal preferences, everyone is free! Br>
I tried a lot of methods before, such as changing the system font in /etc/sysconfig/i18n file, adding the following statement after the [mysqld] field in /etc/my.cnf default-character-set=gb2312 Wait, I don't think it is necessary.
The above steps seem to be very simple, but my failure lessons are also my success. Now share it with you. If you have a look after it, if you don’t like it, it’s not your kind!
Forgot, there is a key point, jdbc must use the appropriate version, before I used It was 3.0.9, it was not found, and later it was replaced with 3.0.16, and it was fine.
1. Log in to Linux with telnet: Need to install telnet related packages for Linux Configure /etc/Xin
We all know how to query the installation time of win7 system? In fact, it is very simple, you can f
As a Linux enthusiast, after several determinations, he gave up the dual system and installed Linux
With the increasing use of Linux, there are a large number of network servers using the Linux operat
Network programming errors and processing under Linux
Local installation of LAMP and WPMU
The colrm command usage in Linux
Quickly create custom software RPM packages in Linux Raiders
Linux partial file operation command usage summary
Anti-spam technology widely used in Linux
Solve ntp error no server suitable for synchronization found
I2C serial bus learning summary
Linux under the dual network card configuration basic tutorial
Famine how to open the map full Famine map full open Raiders
Why does Svchost.exe of Win10 system account for the network speed?
Windows 8 system login is more personalized. You can create picture passwords
Emergency recovery of damaged Windows system (1)
Five system optimizations necessary to install win7 system
How to speed up the network? Cleverly set DNS
RSVS.pif special virus detection method introduced
Win7 64-bit Ultimate IE browser opens after the prompt unresponsive solution