News for hackers. Stuff that matters.
Re:The Python Unicode Mess by joshuamorton on Saturday October 06, 2018 @02:22PM (#18156468)
u"" is a syntax error in python3 (or at least it was for a while, apparently its not anymore, that said...). The correct cross-platform solution is to do

    from __future__ import unicode_literals
which makes python2 string literals unicode unless declared bytes. Then "" strings are always unicode and b"" strings are always bytes, no matter the language version.
Re:The Python Unicode Mess by ak217 on Saturday October 06, 2018 @03:17PM (#18156741)
> u"" is a syntax error in python3

This has not been the case since 2012. The last release of Python 3 for which this was the case reached end of life in February 2016. Please stop misinforming people.

Re:The Python Unicode Mess by Gorgor on Saturday October 06, 2018 @05:33PM (#18157386)
While u"" is accepted in current Python 3, for some reason they ignored the raw unicode string ur"" which still is a syntax error in Python 3. So, unicode_literals is definitely preferable.
Re:The Python Unicode Mess by masklinn on Sunday October 07, 2018 @06:45AM (#18159927)
> The correct cross-platform solution is to do

It's absolutely not correct, because there are many APIs which take "native strings" across versions aka they take an `str` (byte string) in Python 2 and an `str` (unicode string) in Python 3. unicode_literals causes significantly more problems than they solve.

The correct cross-platform solution (and the very reason why the `u` prefix was reintroduced after having initially been removed from Python 3) is in fact to use b"" for known byte strings, u"" for known text, and "" for "native strings" to interact with APIs which specifically need that.