When developing C, C ++, Pro * C, and other programs on Linux or Unix systems, it is inevitable to use the gcc tool, A common Japanese Encoding System in Japanese is Shift-JIS encoding. However, when gcc is used for Shift-JIS encoding, some Chinese characters are garbled, why.
In Shift-JIS encoding, two bytes are used for Chinese characters. When the second byte is 0x5c, garbled characters will occur when gcc is used for compilation. Generally, the following Chinese characters are incorrect.
/X81/x5c ―
/X83/x5c release
/X84/x5c release
/X87/x5c IX
/X89/x5c restart
/X8a/x5c release
/X8b/x5c fraud
/X8c/x5c Gui
/X8d/x5c Structure
/X8e/x5c Silkworm
/X8f/x5c 10
/X90/x5c Application
/X91/x5c Zeng
/X92/x5c release
/X93/x5c restart
/X94/x5c
/X95/x5c table
/X96/x5c violence
/X97/x5c
/X98/x5c Lu
/X99/x5c rabbit
/X9a/x5c
/X9b/x5c release
/X9c/x5c release
/X9d/x5c get
/X9e/x5c release
/X9f/x5c release
/Xe0/x5c restart
/Xe1/x5c release
/Xe2/x5c Bing
/Xe3/x5c release
/Xe4/x5c hip
/Xe5/x5c release
/Xe6/x5c release
/Xe7/x5c release
/Xe8/x5c release
/Xe9/x5c release
/Xea/x5c release
/Xed/x5c restart
/Xee/x5c release
There are three solutions. The first one is the best. Change the encoding, for example, the Japanese EUC encoding or utf8 encoding are OK. The second method is to avoid using the above words, but it is a little difficult, because many of them are also commonly used Japanese characters. The third type is to use escape characters. For example, the word "Yes" is replaced by "/x94/x5c. Of course, another method is to directly add the Backslash "/".