# Problem with ActionWebService and UTF-8 encoding

**URL:** <https://www.ruby-forum.com/t/problem-with-actionwebservice-and-utf-8-encoding/136779>\
**Category:** Rails\
**Created:** [May 6, 2008, 11:43am UTC](https://www.ruby-forum.com/t/problem-with-actionwebservice-and-utf-8-encoding/136779 "2008-05-06T11:43:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [May 6, 2008, 11:43am UTC](https://www.ruby-forum.com/t/problem-with-actionwebservice-and-utf-8-encoding/136779/1 "2008-05-06T11:43:41Z")

</div>

Hello,  
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  
:

$KCODE = ‘UTF8’  
require ‘iconv’

It’s with rails 1.2.6

Any idea ?

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [May 6, 2008, 7:01pm UTC](https://www.ruby-forum.com/t/problem-with-actionwebservice-and-utf-8-encoding/136779/2 "2008-05-06T19:01:35Z")

</div>

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

On Tue, May 6, 2008 at 5:42 AM, David B.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> >

–  
James M.
