0

Can someone tell me what is the default encoding of the serialized string generated by the usage of ObjectMapper.writeValueAsString method ??

I am assuming it should be UTF-8 because this method is used for the purpose of serializing class objects, the output of which is ideally a JSON ??

I have tried checking the documentation but i did not find any specific mention of this UTF-8 around this method.

1 Answers1

0

I believe that Jackson's encoding is not set on a specific method level, but a whole ObjectMapper. By default it uses UTF-8, but in some scenarios UTF-16/32 might be used.

This answer may help you understand the problem https://stackoverflow.com/a/10016086/2879245