Home > Java > javaTutorial > body text

What should I do if the rare characters are garbled when Java reads XML?

coldplay.xixi
Release: 2020-08-21 10:19:34
Original
3462 people have browsed it

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.

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:

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.

What should I do if the rare characters are garbled when Java reads XML?

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template