How is Unicode string literally represented in Python's memory?
For example I could visualize 'abc'
as its equivalent ASCII bytes in Memory. Integer could be thought of as the 2's compliment representation. However u'u2049'
, even though is represented in UTF-8
as 'xe2x81x89'
- 3 bytes long, how do I visualize the literal u'u2049'
codepoint in the memory?
Is there a specific way it is stored in memory? Does Python 2 and Python 3 treat it differently?
Few related questions for anyone curious :
1) How are these strings represented internally in Python interpreter ? I don't understand
2) What is internal representation of string in Python 3.x
See Question&Answers more detail:os