support character encoding (same as levelup does it)