stdout redirection: fixed handling of multibyte characters (#44)