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
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
Convert to UTF-8