From: Jimmy Kofler Date: 2008-05-01T23:03:25+09:00 Subject: Re: UTF-8 in Ruby > UTF-8 in Ruby > Posted by Vaibhav Bhandari (Guest) on 03.04.2008 18:05 > hi all - > > Whats the recommended way to ensure that a string sent over the wire is > UTF-8. I want to do a post to a web-service and the content needs to be UTF-8. > > Whats the best way to do - > "content".encoding('UTF-8') > > Thanks in advance. > > regards, > Vaibhav You may also use UTF8REGEX in methods like: "str".utf8? "str".clean_utf8 See: http://snippets.dzone.com/posts/show/4527 http://www.w3.org/QA/2008/03/html-charset.html Cheers, jk -- Posted via http://www.ruby-forum.com/.