I have a web service that receives a parameter in ISO-8859-1 encoding.
But when I try to read it from the request, I get this characters:
�����
I've tryied all these approaches, but none of the convert the given string to the expected one (áéíóú):
val a = new String(_html.getBytes());
val b = new String(_html.getBytes(), "UTF-8")
val c = new String(_html.getBytes(), "ISO-8859-1")
val d = new String(_html.getBytes("ISO-8859-1"), "UTF-8")
val e = new String(_html.getBytes("ISO-8859-1"), "ISO-8859-1")
val f = new String(_html.getBytes("UTF-8"), "UTF-8")
val g = new String(_html.getBytes("UTF-8"), "ISO-8859-1")
Here is my action:
val inboundMessageForm = Form(
mapping(
"html" -> text)(InboundMessage.apply)(InboundMessage.unapply))
def forward = Action(parse.multipartFormData) { implicit request =>
val inboundMessage = inboundMessageForm.bindFromRequest.get
// inboundMessage.html => �����
}
What can I do to solve this problem?