I encountered a difficult problem today. Adding some js files to an old project was inconsistent with the encoding format of the old project, resulting in garbled characters. The old page is GB2312, the linked js file is UTF-8, and neither file can be converted.
The first idea is to convert the Chinese in the js file to unicode encoding. This approach is based on sacrificing readability, and all Chinese characters become passwords.
After thinking about it, there should be a better way, and then go to Baidu. The method is as follows: