and if already set to make sure the utf-8 flag is not cleared from the tty. Patch from Samuel Thibault.