By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,587 Members | 1,677 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,587 IT Pros & Developers. It's quick & easy.

parsing non-ascii characters

P: n/a
Hello all,

I have a list:
suffix = ["aĉ", "ad", "aĵ", "an", "ar"]

and I'm trying to check a word to see if any of the suffixes exist in
the list for example:
if word in suffix:
print "A suffix exist in your word"

when I run this it give me an error:
SyntaxError: Non-ASCII character '\xc5' in file vortaro.py on line
33, but no encoding declared;

is there a way to parse Non-ASCII characters in python?

Thanks in advance,
Ronn
Nov 10 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Nov 10, 1:13*pm, Ronn <ronn.r...@gmail.comwrote:
Hello all,

I have a list:
* suffix = ["aĉ", "ad", "aĵ", "an", "ar"]

and I'm trying to check a word to see if any of the suffixes exist in
the list for example:
* if word in suffix:
* * * print "A suffix exist in your word"

when I run this it give me an error:
* *SyntaxError: Non-ASCII character '\xc5' in file vortaro.py on line
33, but no encoding declared;
Read this:
http://docs.python.org/tutorial/inte...-code-encoding

Read all of the tutorial.
is there a way to parse Non-ASCII characters in python?
This question is meaningless.
Nov 10 '08 #2

P: n/a
On Nov 10, 10:13*am, Ronn <ronn.r...@gmail.comwrote:
Hello all,

I have a list:
* suffix = ["aĉ", "ad", "aĵ", "an", "ar"]

and I'm trying to check a word to see if any of the suffixes exist in
the list for example:
* if word in suffix:
* * * print "A suffix exist in your word"

when I run this it give me an error:
* *SyntaxError: Non-ASCII character '\xc5' in file vortaro.py on line
33, but no encoding declared;

is there a way to parse Non-ASCII characters in python?

Thanks in advance,
Ronn
http://www.python.org/dev/peps/pep-0263/
Nov 10 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.