astral1/indextank-engine — comment on commit e5e15288e0e7d2cdb2b8634fedcee591af467f3a
File:  line 0
By adrnai:

You can avoid making 2 calls (setCharacterEncoding, setContentType), setContentType will also set the character encoding.
Another option is doing setContentType("application/json") and a setCharacterEncoding(enc) after; that will render the "application/json; charset=%s" on the content type.