"SyntaxError: Non-ASCII character '\xc2'...", was Re: Is there a nicer way to do this?

Victor B. Gonzalez python.comp.lang.id982 at vbgunz.com
Fri Oct 5 12:27:53 EDT 2007


On Friday 05 October 2007 3:33:43 am Peter Otten wrote:
> Victor B. Gonzalez wrote:
> > anyhow, I keep getting "SyntaxError: Non-ASCII character '\xc2'..." on
> > line 5. anyone know what this is?
>
> I too had that problem with KNode. Leading space consists of NO-BREAK SPACE
> (unichr(160)) which translates to '\xc2\xa0' in UTF-8. As I don't see this
> problem here (using pan) I suspect it may be specific to KMail/KNode.
>
> Peter

You're right, thank you for pointing that out. I am bad with almost anything 
like \this but stripping off the leading whitespace solved the issue. thank 
you for the heads up!

-- 
Best Regards
Victor B. Gonzalez



More information about the Python-list mailing list