Home >Java >javaTutorial >How to solve the problem that json format is incorrect
Solution to incorrect json format: 1. Open [Format] and remove the [Encode in utf-8 without BOM format] option; 2. Remove the BOM header directly in the java code.
Solution to incorrect json format:
Method 1: Remove the utf8 BOM format, this is Because we use utf-8 encoding when writing json files, and the utf8 BOM format is incompatible with the json format, we only need to remove the utf8 BOM format.
Method 2: We can remove the BOM header directly in the java code. When writing code, you can simply remove the BOM header in the code.
Related learning recommendations: java basic tutorial
The above is the detailed content of How to solve the problem that json format is incorrect. For more information, please follow other related articles on the PHP Chinese website!