[Baypiggies] Unicode woes using print and redirects...

Aahz aahz at pythoncraft.com
Sat Aug 22 02:31:48 CEST 2009


On Fri, Aug 21, 2009, Mitch Patenaude wrote:
>
> If there is a unicode specific string it does the right thing as long
> as stdout hasn't been redirected.
> 
> I have tired to use the codec.EncodedFile to wrap sys.stdout and try
> to get it to recode the output, or fool it into thinking that stdout
> can handle utf8 in either case, but that only causes *both* cases to
> fail, even though I pass in either errors='ignore' or
> errors='replace'.  I'm stumped.  Can anyone enlighten me?

What version of Python?  Check the FAQs on python.org -- this is a
typical question on c.l.python, though I don't remember the answer
off-hand.  (Also check Google.)
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I support family values -- Addams family values" --www.nancybuttons.com


More information about the Baypiggies mailing list