Fixed stdin and stdout encoding in prog