module RomanKana::Utils
Public Class Methods
convert_utf8(str)
click to toggle source
# File lib/romankana/utils.rb, line 8 def self.convert_utf8 str return (str.encoding != Encoding::UTF_8) ? str.encode(Encoding::UTF_8) : str end
set_encoding_of_before(before, after)
click to toggle source
# File lib/romankana/utils.rb, line 3 def self.set_encoding_of_before before, after e = before.encoding return (e == Encoding::US_ASCII or e == Encoding::ASCII_8BIT) ? after : after.encode(e) end