, , , , PostgrSQL, UTF-8. , Rails UTF-8 .
( , ):
-, , config.encoding "utf-8" config/application.rb.
Ruby 1.9, toutf8.
, , SET CLIENT_ENCODING TO 'ISO-8859-1'; ( , ) PostgeSQL, . RESET CLIENT_ENCODING; reset .
Ruby 1.8 ( ), iconv UTF-8. . .
- (.. content content=) Base64. :
require 'base64'
class Comment
def content
Base64::decode64(self[:content])
end
def content=(value)
self[:content] = Base64::encode64(value)
end
end