Source code enthusiast layer and Layout
Effect:
The drag prompt layer (mode window) is displayed)
[Original] solve Chinese garbled JavaScript code
Http://www.cnblogs.com/xjyggd/archive/2009/04/14/1436000.html
[
Original] solve JS Chinese garbled characters
Method 1: < Script SRC = " ../JS/common. js " Type = " Text/JavaScript " Charset = " Gb2312 " > </ Script > Add charset = " Gb2312 " You can.
Method 2: Change the JS file encoding to UTF. - 8 (Default vs2005 code)
Method 3: Change the Asp.net page output code to gb2312 (page / Web. config can be set)
Content Encoding format of cookies
The value of cookies can contain punctuation marks other. However, Chinese characters cannot be saved. Garbled characters appear when saving Chinese characters.
Therefore, cookies must be encoded and decoded in a unified manner. To enable decoding and encoding on both the browser and server, the UTF Encoding format must be used in a unified manner.
This is mainly because only UTF Encoding formats can be used in JavaScript.