<div dir="ltr"><div>Context: I'm getting</div><div><br></div><div><div>UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 7: ordinal not in range(128) </div><div><br></div>
</div><div>from the code</div><div><br></div><div>print '%s%s%s' % (prefix, value, suffix),<br></div><div><br></div><div>[Here, 'value' contains unicode characters, while prefix and suffix contain 7-bit characters.]</div>
<div><br></div><div><br></div>So I went to <a href="http://docs.python.org/2/howto/unicode.html#reading-and-writing-unicode-data">http://docs.python.org/2/howto/unicode.html#reading-and-writing-unicode-data</a><div>to determine what I should do to fix my bug. I saw the section "<a class="" href="http://docs.python.org/2/howto/unicode.html#reading-and-writing-unicode-data" style="color:rgb(152,219,204);font-family:sans-serif;font-size:14.40000057220459px;background-color:rgb(28,78,99)">Reading and Writing Unicode Data</a>", which seemed relevant. That section doesn't seem to discuss printing to stdout.</div>
<div><br></div><div><br></div><div>No doubt I got confused and didn't read carefully enough, but it might be the case that if the Reading and Writing section had an example of printing a unicode string to stdout that it would have helped me find a solution faster.</div>
<div><br></div><div>g'luck, Chuck<br><div><br></div></div></div>