Jersey seems to fail when returning JSON...
This:
@GET
@Produces( MediaType.APPLICATION_JSON + ";charset=UTF-8")
public List<MyObject> getMyObjects() {
return ....;
}
is needed to return JSON utf-8 encoded. If I use only
@Produces( MediaType.APPLICATION_JSON)
fails and for example German umlaute (ü??), will be returned in a wrong way.
Two questions:
1 - For JSON utf-8 ist standard - why not with Jersey?
2 - Can I set utf-8 for the whole REST-Servlet if a JSON Request comes in?
I am using Jersey 1.5 and CRest 1.0.1 on Android...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…