From dfc422b784d3f62daa5a876d65b0ac983c33408a Mon Sep 17 00:00:00 2001 From: Leon Breedt Date: Wed, 13 Jul 2005 06:05:13 +0000 Subject: always send back SOAP responses as UTF-8, we can't guarantee that SOAP4R supports any encoding sent by caller. add documentation describing how to ensure :string types don't get converted into :base64 by SOAP4R when containing non-ASCII chars and $KCODE is not set to a value. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1822 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionwebservice/README | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'actionwebservice/README') diff --git a/actionwebservice/README b/actionwebservice/README index a725f9db71..5b82475fe2 100644 --- a/actionwebservice/README +++ b/actionwebservice/README @@ -215,6 +215,25 @@ custom types and message definition types: The default namespace used is 'urn:ActionWebService', if you don't supply one. + +== ActionWebService and UTF-8 + +If you're going to be sending back strings containing non-ASCII UTF-8 +characters using the :string data type, you need to make sure that +Ruby is using UTF-8 as the default encoding for its strings. + +The default in Ruby to use US-ASCII encoding for strings, which causes a string +validation check in the Ruby SOAP library to fail and your string to be sent +back as a Base-64 value, which may confuse clients that expected strings +because of the WSDL. + +Two ways of doing setting the default string encoding are: + +* Start Ruby using the -Ku command-line option to the Ruby executable +* Set the $KCODE flag in config/environment.rb to the + string 'UTF8' + + == Testing your APIs -- cgit v1.2.3