Home >Java >javaTutorial >What should I do if the rare characters are garbled when Java reads XML?
Solution to the problem of garbled characters when Java reads XML: First open the XML file with Notepad and change [encoding="gb2312"] in the first line to [="utf-8" 】; Then save it as, and change the encoding method from ANSI to [UTF-8]; finally, when you use the program to read it, the output will be normal.
Solution to the problem of garbled characters when java reads XML:
Use Notepad to copy the XML file Open it, change the encoding="gb2312" in the first line to encoding="utf-8" , then save it as, change the encoding method from ANSI to UTF-8, and when reading it with the program, the output will be normal. solve.
Related learning recommendations: java basic tutorial
The above is the detailed content of What should I do if the rare characters are garbled when Java reads XML?. For more information, please follow other related articles on the PHP Chinese website!