[Tutor] encoding question

eryksun eryksun at gmail.com
Sun Jan 5 01:42:31 CET 2014


On Sat, Jan 4, 2014 at 7:15 PM, Alex Kleider <akleider at sonic.net> wrote:
>>
>> py> 'Bogotá'.encode('utf-8')
>
> I'm interested in knowing how you were able to enter the above line
> (assuming you have a key board similar to mine.)

I use an international keyboard layout:

https://en.wikipedia.org/wiki/QWERTY#US-International

One could also copy and paste from a printed literal:

    >>> 'Bogot\xe1'
    'Bogotá'

Or more verbosely:

    >>> 'Bogot\N{latin small letter a with acute}'
   'Bogotá'


More information about the Tutor mailing list