4

How can I encode a string (iso to utf-8 for example) in Ruby on Rails, using Ruby 1.8.7 ?

1
  • 1.8 isn't encoding-aware, so you'd have to guess the encoding, and trust me, you don't want that. Upgrade to 1.9 Commented Apr 25, 2012 at 16:28

1 Answer 1

5

Use toutf8 method.

"my string".toutf8
Sign up to request clarification or add additional context in comments.

1 Comment

Use ICONV or Ruby 1.9 methods.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.