Search code examples
pythonutf-8pydevaptananon-ascii-characters

Cannot print non-english characters in Aptana


I'm new to both Aptana and Python.

Is there a way to print non-english characters? like ñ é ψ ü etc.

Now, when I try to: print "ñ" for example, I get a:

SyntaxError: Non-ASCII character '\xc3' in file D:\Users\User1\Documents\Aptana Studio 3 Workspace\Testing\stuff.py on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

I do have the encoding se to utf-8 in: Window > Preferences > General > Workspace > Text encoding


Solution

  • add this

    # -*- coding: utf-8 -*-
    

    on the top of your python file