Ajax In place edit with Struts

Hi All,
First of all my apologies if this is not a correct place to post it.
Please direct me to correct place. I am using scripataculous inplace
edit with struts framework. I am having some text with double quotes and
single quote. If the user types it normally then in the callback
function i am doing encodeURIComponent before doing a post and
everything works fine. I have the encoding set to UTF-8. But if the user
copy/paste from MS Word then i am having issues. It becomes Weird
characters. When I tried this in ROR framework everything worked fine. I
dont know how ROR handles the encoding. Please let me know if anyone had
any idea what I am missing.

This is the way that I am calling the script…
new Ajax.InPlaceEditor(‘1’,
‘<%=request.getContextPath()%>/examples/test.do?method=post’,{ callback:
function(form, value) { return ‘gText=’ + encodeURIComponent(value)},
cancelLink:false, okText:“Save”, ajaxOptions: {method: ‘post’}});
This is the text that I am entering â?bâ??cosâ? and it becomes like this
when it comes back �b�cos�.
Regards,
P.