Going by what you've shown in your example, you seem to be using the fluent API.
Looking into the javadocs there is a version of request.bodyForm()
that accepts a charset:
import org.apache.http.Consts;
...
request = request.bodyForm(form.build(), Consts.UTF_8);
According to the source, the charset defaults to Consts.ISO_8859_1
(a.k.a. Latin-1).
Alternatives
If that doesn't work, consider:
import org.apache.http.Consts; ... request.elementCharset(Consts.UTF_8);
As a last resort, it should be possible to set the content charset. Looking at the source for
elementCharset()
, you could try the following:import org.apache.http.Consts; import org.apache.http.params.CoreProtocolPNames; ... request.config(CoreProtocolPNames.HTTP_CONTENT_CHARSET, Consts.UTF_8);