fixed output encoding if LC_CTYPE locale is not utf8