method
from_iso_8859_15
v1_9_2_180 -
Show latest stable
- Class:
REXML::Encoding
from_iso_8859_15(str)public
Convert to UTF-8
# File lib/rexml/encodings/ISO-8859-15.rb, line 51
def from_iso_8859_15(str)
array_latin9 = str.unpack('C*')
array_enc = []
array_latin9.each do |num|
case num
# characters that differ compared to iso-8859-1
when 0xA4; array_enc << 0x20AC
when 0xA6; array_enc << 0x0160
when 0xA8; array_enc << 0x0161
when 0xB4; array_enc << 0x017D
when 0xB8; array_enc << 0x017E
when 0xBC; array_enc << 0x0152
when 0xBD; array_enc << 0x0153
when 0xBE; array_enc << 0x0178
else
array_enc << num
end
end
array_enc.pack('U*')
end Related methods
- Instance methods
- check_encoding
- decode
- decode_ascii
- decode_cp1252
- decode_eucjp
- decode_iconv
- decode_sjis
- decode_unile
- decode_utf16
- decode_utf8
- encode
- encode_ascii
- encode_cp1252
- encode_eucjp
- encode_iconv
- encode_sjis
- encode_unile
- encode_utf16
- encode_utf8
- encoding=
- from_iso_8859_15
- to_iso_8859_15
- Class methods
- apply
- encoding_method
- register