test encoding and fallback to utf-8