In this blog post, we'll explore an interesting behavior of Gson: HTML escaping. By default, Gson escapes typical HTML characters, like <
or >
to \u003c
and \u003e
. If your server can handle these tags just fine, you might be interested in disabling this behavior. In this tutorial we'll show you how you can achieve that.
Of course, this will not be the only post in our Gson series. If you're interested in the other topics, check out our series outline:
Gson Series Overview
- Mapping of Enums
- Mapping of Circular References
- Generics
- Custom Serialization for Simplification (Part 1)
- Changing the Default Serialization with Custom Serialization (Part 2)
- Custom Deserialization Basics
- Custom Instance Creator
- Customizing (De)Serialization via @JsonAdapter
- Custom Deserialization for Calculated Fields
- On-The-Fly-Parsing With Streams
- ProGuard Configuration