String to Json turning ' to unicode

when i turn the string: "You have set your @pokemon's nature to @nature." to a json file using Gson i get: "nature": "You have set your @pokemon\u0027s nature to @nature.", and u can see that the ' turned into \u0027s its working well, and loading from json to string as expected but i want it to stay as ' and not change my code:
Gson gson = Utils.newGson();
String data = gson.toJson(this);
CompletableFuture<Boolean> futureWrite = Utils.writeFileAsync(PokeTrainer.POKE_TRAINER_PATH, "feedbacks.json", data);
Gson gson = Utils.newGson();
String data = gson.toJson(this);
CompletableFuture<Boolean> futureWrite = Utils.writeFileAsync(PokeTrainer.POKE_TRAINER_PATH, "feedbacks.json", data);
public static Gson newGson() {
return new GsonBuilder().setPrettyPrinting().create();
}
public static Gson newGson() {
return new GsonBuilder().setPrettyPrinting().create();
}
6 Replies
JavaBot
JavaBot11mo ago
This post has been reserved for your question.
Hey @MoonSouhayl! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
MoonSouhayl
MoonSouhaylOP11mo ago
this is the class where i have a Map that has the String
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
MoonSouhayl
MoonSouhaylOP11mo ago
Thanks!
JavaBot
JavaBot11mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
JavaBot
JavaBot11mo ago
Post Closed
This post has been closed by <@883785612979740692>.

Did you find this page helpful?