Google

def utf8_enc(str) if @encoding==ISO_8859_1 asc(str) elsif @encoding==UTF16 utf16(str) elsif @encoding==UNILE unile(str) else return str end end