Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
A few questiosn about encoding
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Îικόλαος ΚοÏÏας, post: 5099126"] On 13/6/2013 2:49 μμ, Steven D'Aprano wrote: Please confirm these are true statement: A code-point and the code-point's ordinal value are associated into a Unicode charset. They have the so called 1:1 mapping. So, i was under the impression that by encoding the code-point into utf-8 was the same as encoding the code-point's ordinal value into utf-8. So, now i believe they are two different things. The code-point *is what actually* needs to be encoded and *not* its ordinal value. But byte objects are represented as '\x' instead of the aforementioned '0x'. Why is that? Thank you didn't knew that! indeed it working like this. To encode a number we have to turn it into a string first. "16474".encode('utf-8') b'16474' That 'b' stand for bytes. How can i view this byte's object representation as hex() or as bin()? ============ Also:17 You said this string consists of 17 chars. Why the leading syntax of '0b' counts as bits as well? Shouldn't be 15 bits instead of 17? [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
A few questiosn about encoding
Top