[Tutor] strings using Czech language characters
Kent Johnson
kent37 at tds.net
Sun May 24 13:34:55 CEST 2009
On Sat, May 23, 2009 at 11:31 PM, Leon Williams <gsumalenurse at yahoo.com> wrote:
> Hello,
>
> I wish to make a dictionary of english to czech words. I thought I would
> first see if python will print a czech character. I used the example in the
> tutorial (it uses a euro symbol, and a different iso character set so I
> changed mine to include a character set that includes eastern european
> characters). My results follow:
>
>>>> # -*- coding: iso_8859-2 -*-
>>>> cz_c = u"č"
> Unsupported characters in input
The coding declaration only affects the encoding of program files, not
the interactive interpreter.
I have some notes here hthat may help:
http://personalpages.tds.net/~kent37/stories/00018.html
Try
cz_c = "č".decode(sys.stdin.encoding)
Kent
More information about the Tutor
mailing list