Fix free order.
Fix bug with charset conversion.

Glib iconv understands only uppercase for charset names.