allow ENV overrides, fixed default encoding issue