Change encoding to utf-8 when needed