Ajax / GroovyGrails Post data coming over with unexpected leading character. Who is encoding/decod
- by ?????
I'm having an encoding issue, and I'm not sure where to look for the problem.
I have this Ajax.Request function (prototype library) sending data to a Groovy/Grails encoder
var myAjax = new Ajax.Request(url, {method:'post', encoding:'UTF-8', contentType:'application/x-www-form-urlencoded', parameters:{'content':new_content}, onSuccess:success, onFailure:failure});
The data is coming in with an unexpected %A0 at the beginning:
I have this simple controller that just echos the content back:
def titlechange = {
def content = URLDecoder.decode(params['content'])
printf("Content: %s; DecodedContent = %s\n", params['content'], content)
response.characterEncoding='UTF-8'
render content
}
the debug print statement shows:
Content: %A0Hello%2C%20world%21; DecodedContent = †Hello, world!
Where is that %A0 coming from?
My grails configuration has this:
// The default codec used to encode data with ${}
grails.views.default.codec="none" // none, html, base64
grails.views.gsp.encoding="UTF-8"
grails.converters.encoding="UTF-8
Is the issue on the grails side or on the JavaScript side?