Causes of garbled characters
MySQL character encoding is introduced in version 4.1 and supports multiple languages. In addition, some features have exceeded those of other database systems.
Run the following command under MySQL command line client to view the MySQL character set:
Mysql> show character set;+ ---------- + ----------------------------- + --------------------- + -------- +| Charset | descr
how do we go about specifying the character set of the database? Below also GBK for example
"CREATE database in MySQL Command line client"
mysql> CREATE TABLE ' Mysqlcode ' (
' ID ' TINYINT (255) UNSIGNED not NULL auto_increment PRIMARY KEY,
' Content ' VARCHAR (255) Not NULL
) TYPE = MYISAM CHARACTER SET gbk COLLATE gbk_chinese_ci;
Query OK, 0 rows affected, 1 warning (0.03 sec)
Current 1/3 page 123 next page
The above describes the summary under the MySQL Chinese
Causes of garbled charactersMysql character encoding is introduced in version 4.1 and supports multiple languages. In addition, some features have exceeded those of other database systems.Run the following Command under MySQL Command Line Client to view the mysql character set:Mysql> show character set;+ ---------- + ----------------------------- + --------------------- + -------- +| Charset | Description |
Several causes of MySQL garbled characters and MySQL garbled characters
MySQL is garbled for the following reasons:
1. garbled characters before they are stored in the database
2. garbled Characters During database saving
3.
The Java kernel is Unicode, that is, Unicode is used to represent characters when the program processes characters, but the file and stream are stored in byte streams. In the Basic Data Type of Java, char is Unicode and byte is byte. Therefore, Java needs to convert byte streams and char in different links. If the character set encoding is improperly selected during this conversion, garbled characters may occur.
There are several common
CSS character encoding causes garbled characters and css characters
CSS failure caused by garbled characters:Because a Chinese character is composed of two characters, if the encoding is inconsistent, it will lead to a "re-" combination of characters, (a new "text" is generated when the encoding character of the half Chinese character is combined with the subsequ
"Inconsistency" between "LINUX system" and "client" causes "garbled display" and "linux" are inconsistent
Original Works are from the blog of "Deep Blue blog". You are welcome to reprint them. Please note the following source when reprinting them. Otherwise, you will be held legally liable for copyright.
Deep Blue blog: http://blog.csdn.net/huangyanlong/article/details/40979421
Lab Environment
Scenario 1
Recently, students often encounter such coding errors when using Lamp/wamp:
A website program encoding UTF-8 code installed successfully, running successfully.
B website program gb2312 also installed on the same server.
This is a problem, the Apache default encoding UTF-8 in the resolution of a site when there is no problem, when running B site when the "Shingwen" garbled problem.
Simply modify the Apache default encoding for gb2312 This
Solution for inconsistent file encoding causes file garbled characters
I have been working on the data encryption function of an android application over the past few days. To prevent the encryption and decryption algorithms from being cracked, I have encapsulated the core encryption and decryption algorithms in JNI, only expose the interface to the java layer.
The workflow is as follows:
1. Use a self-writ
Several causes of MySQL garbled characters
MySQL is garbled for the following reasons:
1. garbled characters before they are stored in the database
2. garbled Characters During database saving
3. garbled characters after being
URL has been submitted, these parameters will be passed to the background code, the background code will be transferred to another front-end JSP page, the parameters of the pass display. In this case, the backend code is only responsible for the relay, not the upload parameters for processing. But there was a problem on the display page:(Because some of the other items are normal, there is no) the parameter code and the parameter name of the original Chinese are all messed up.IdeasRecall the en
), modify the client language[Email protected] ~]# lang=en-- You can resolve this issue by modifying the language to EnglishSupplementary note: Follow-up questions, although garbled phenomenon disappears, but want to use the CRT remotely for Setup option setting, some functions can not be entered, so if you want to complete setup through Setup, we recommend using Remote Desktop, complete Setup setup within the operating system.Scenario Two: Client CRT
" with GBK to binary number is 11010110110100001011100111111010 (in GBK each Chinese character corresponds to two bytes, each byte corresponds to a 8-bit binary number, so this string number should be 32 bits, corresponding to "China" two Chinese characters, Don't believe you can count, hehe. ), and then this string of binary number with UTF-8 converted into characters, it is certainly not the original "China" (because in the UTF-8 character set, a character corresponds to three bytes, so with t
Android uses UDP to transmit data, which causes Chinese garbled characters. Android udp
Recently, the company needs to develop towards the smart home industry. We need to use UDP to transmit data and find some information on the Internet. However, we found garbled Characters During Chinese transmission, the problem is finally solved. The following is the key code
others are similar to these. After careful analysis, think the 4th method is the best solution to the current problem, the Chinese parameters such as 4 of the operation. But another problem arises, because this is a user can freely enter the link address of the function, so the first thing to do is to analyze the link URL, parse out the parameters, and then 4 of these parameters to operate, and then together to spell the original URL address.Fortunately, the URL parameter resolution C # already
Q: I am using the computer due to power outages caused by abnormal shutdown, restart Windows XP found in the application window to minimize, maximize and turn off button small icon some become 1, 2, 3, and some have been changed to be a question mark or garbled. Excuse me, how is this going to work out?
A: This is a common failure of Windows XP because the abnormal shutdown causes the graphics library on t
Tags: code strong tail Console Word page title input garbledhow MySQL permanently resolves the display garbled by DOS encoded format that causes MYSQⅠ, new file ChangeCode.txtⅡ, paste the following code (function: Modify the default GBK (936) to UTF-8 (65001))1Windows Registry Editor Version5.002 3 4 5[hkey_current_user\console\%systemroot%_system32_cmd.exe]6 7 "CodePage"=Dword:0000fde98 9 "FontFamily"=dwor
DELIMITER $$Use ' u2_test10 ' $$DROP PROCEDURE IF EXISTS ' pro_apply ' $$CREATE definer= ' root ' @ '% ' PROCEDURE ' pro_apply ' (in aid int,in UID Int., inreas CHAR () CHARACTER SET UTF8)//char ( 50) This only urf-8BEGINDECLARE score INT;SELECT COUNT (*) into score from app_apply WHERE appid= aid and Applyuserid=uid;IF score = 0 ThenINSERT into app_apply (appid,reason,applyuserid,applytime, ' status ') VALUE (Aid,reas,uid,now (), 0);ELSEUPDATE app_apply SET reason=reas, status=0 WHERE appid=aid
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.