1

I've read that the Unicode encryption encompasses all other character encrpytions, but why do I get an error when trying this. I know I can decode with Latin but Unicode should be a superset.

'été'.decode('utf-8') 
1

1 Answer 1

1

You need to tell Python the encoding of your source file:

# coding=utf-8 a = 'été'.decode('utf-8') print a 

See PEP 263 for more details. Here's a relevant snippet:

To define a source code encoding, a magic comment must be placed into the source files either as first or second line in the file

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.