Can you avoid Gson converting “<” and “>” into unicode escape sequences?

前端 未结 1 1965
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 00:36

I noticed that Gson converts the string \"<\" into an unicode escape sequence in JSON output. Can you avoid this somehow, or do characters like \"<\" and \">\" always

1条回答
  •  抹茶落季
    2020-12-01 01:00

    You need to disable HTML escaping.

    Gson gson = new GsonBuilder().disableHtmlEscaping().create();
    

    0 讨论(0)
提交回复
热议问题