News for hackers. Stuff that matters.
Re:Numpy: Plan for dropping Python 2.7 support by int_19h on Wednesday November 15, 2017 @10:21PM (#15710048)
You don't need to do any of that. If you use `input()`, you get a string - all conversions are done for you. If you're reading from a file (or from stdin, treating it as a file object), again, in text mode you just get strings. Same thing for printing - if you print strings, they will get converted to the encoding appropriate for the target terminal.

So, what is it exactly that you're trying to do?

Re:Numpy: Plan for dropping Python 2.7 support by jimmaswell on Wednesday November 15, 2017 @10:23PM (#15710056)
IRC logs with IRC control code characters in them don't work nicely with python 3 text strings, for example.
Re:Numpy: Plan for dropping Python 2.7 support by int_19h on Saturday November 18, 2017 @10:28AM (#15729304)
Why not? There's no restriction on what kinds of characters can appear inside a Python Unicode string.

Or do you mean that the text in the log is UTF-8, but the log itself as a whole is not, because those control characters are mixed into it in (effectively) a different encoding? Then the log isn't a single string, and shouldn't be treated as such.