SyntaxError: python Arabic encoding
Question: I have this Code -I am using Python 2.7- :

    
    
    #!/usr/bin/python
    # -*- Coding: UTF-8 -*-
    import nltk
    from nltk.tokenize import StanfordTokenizer
    sentence = u"السلام عليكم و رحمة الله و بركاته"
    print StanfordTokenizer().tokenize(sentence)
    

I saved the code in a file called example.py, when I write python example.py
in the terminal I get the following error:

    
    
    File "example.py", line 5 
    SyntaxError: Non-ASCII character '\xd8' in file example.py on line 5, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
    

I already declared the type of encoding as UTF-8. So what is the problem?
However, if I run the code line by line in the terminal it is working and no
error.


Answer: > ... the first or second line must match the regular expression "^[
> \t\v]_#._?coding[:=][ \t]*([-_.a-zA-Z0-9]+)".

[source](https://www.python.org/dev/peps/pep-0263/)

Your encoding declaration does not match that regex. The `c` needs to be
lowercase.

