What about `sys.stdout.encoding` - that's `UTF-8` in the terminal and the Qt console for me. Plus it makes more sense to check it for output. There's some reason we look at stdin elsewhere, but I forget what it is.