Largo
Largo

Reputation: 497

Problems with Encoding in Eclipse Console and Python

I guess I need some help regarding encodings in Python (2.6) and Eclipse. I used Google and the so-search and tried a lot of things but as a matter of fact I don't get it.

So, how do I achieve, that the output in the Eclipse console is able to show äöü etc.?

I tried: Declaring the document encoding in the first line with

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

I changed the encoding settings in Window/Preferences/General/Workspace and Project/Properties to UTF-8

As nothing changed I tried the following things alone and in combination but nothing seemed to work out:

print u"äöü".encode('UTF8')

I am trying to do this in order to debug the encoding-problems I have in my programs... (argh)

Any ideas? Thanks in advance!

EDIT: I work on Windows 7 and it is EasyEclipse

Upvotes: 2

Views: 5322

Answers (2)

Alex
Alex

Reputation: 31

Even this is a bit old question, I'm new in StackOverflow and I'd like to contribute a bit. You can change the default encoding in Eclipse (currently Neon) for the all text editors from the menu Window -> Preferences -> General -> Workspace : Text file encoding

Item Path

Upvotes: 3

Largo
Largo

Reputation: 497

Got it! If you have the same problem go to

Run/Run Configurations/Common and select the UTF-8 (e.g.) as console encoding.

So, finally, print "ö" results in "ö"

Upvotes: 7

Related Questions