Lucas Renan
Lucas Renan

Reputation: 3917

Encode a String in Ruby on Rails

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

Upvotes: 4

Views: 2522

Answers (1)

Simone Carletti
Simone Carletti

Reputation: 176382

Use toutf8 method.

"my string".toutf8

Upvotes: 5

Related Questions