Please provide the minimum code that reproduces the problem, and the full traceback.
Regards,
Antonis
Please read my email again.
Antonis Christofides +30-6979924665 (mobile)
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cf785c0e-5cfc-4587-b0cd-ea796a62a20bn%40googlegroups.com.
Hello,
try this:
book.title = u'Verità'
Regards,Antonis
P.S. Sorry I was a bit harsh yesterday—I had drunk too much beer :-)
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e2df5c07-5dd3-4fc3-9034-1955d438b670n%40googlegroups.com.
Exactly. The important thing to remember here is that, in Python 2, a "string" is actually a list of bytes, whereas a "unicode string" is actually a list of characters (not a list of unicode characters—just a list of characters). The confusion arises because, when Python was created, i.e. in 1990, multi-byte characters were in their infancy, and we mostly assumed that a character and a byte was more or less the same thing.
In Python 3, the Python 2 "strings" were renamed to "bytes", and the Python 2 "unicode strings" were renamed to "strings"—and the syntax for the literals of these types also changed. This made it way better.
More information about all this is in
https://djangodeployment.com/2017/06/19/encodings-part-1/.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fb8bed42-b1f9-4aba-aa9d-c87b06cc774cn%40googlegroups.com.