Problem with ActionWebService and UTF-8 encoding


I have a Rails App which serve a Soap Web Service with ActionWebService.

I accept 2 string parameters that must contain xml.

The data sent are in UTF-8, but the non-ascii char (é, à …) in the message are crippled at the end.

I tested the app, database, html, … all accept utf-8, a direct http post works well, but going through the web service broke the content.

I tried to manually set the $KCODE en require de iconv in environment.rb :


require ‘iconv’

It’s with rails 1.2.6

Any idea ?



Did you try setting up the character encoding for the page?

<meta http-equiv="content-type" content="text/html; charset=utf-8">