<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>Exec a unicode problem</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Zdravim,<BR>
umel by jste mi nekdo vysvetlit proc mi volani exec(script2) hazi chybu (UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-1: character maps to <undefined>)? A jak to obejit.<BR>
<BR>
#!/usr/bin/python<BR>
#-*- coding: utf8 -*-<BR>
<BR>
def out(text):<BR>
print text<BR>
<BR>
s = u'Žlutư kůň.'<BR>
script1 = "out(s)"<BR>
script2 = "out(u'Žlutư kůň.')"<BR>
<BR>
print s<BR>
exec(script1)<BR>
exec(script2)<BR>
<BR>
<BR>
Diky,<BR>
David</FONT>
</P>
</BODY>
</HTML>