mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
15 lines
253 B
Ruby
15 lines
253 B
Ruby
|
require "iconv"
|
||
|
raise LoadError unless defined? Iconv
|
||
|
|
||
|
module REXML
|
||
|
module Encoding
|
||
|
def decode( str )
|
||
|
return Iconv::iconv(UTF_8, @encoding, str)[0]
|
||
|
end
|
||
|
|
||
|
def encode( content )
|
||
|
return Iconv::iconv(@encoding, UTF_8, content)[0]
|
||
|
end
|
||
|
end
|
||
|
end
|