When we change the word Ueber to the correct German Űber using the umlaut character the Eclipse PyDev plugin is not too happy:
We get an error message, which is a little bit confusing because, when we run the same line of code from within the Eclipse PyDev Console, we get the expected result:
When we ask for the Python default encoding we get the expected result, which is utf-8:
Using Windows' built-in character map, we can find the Unicode representation of the umlaut character, which is U+00DC for the capital U with an umlaut:
While this workaround is truly ugly, it does the trick. Instead of typing in the literal character Ü, we can pass in the Unicode of U+00DC to get this character correctly displayed in our GUI:
We can also just accept the change in the default encoding from Cp1252 to UTF-8 using PyDev with Eclipse but we may not always get the prompt to do so.
Instead, we might see the following error message displayed:
The way to solve this problem is to change the PyDev project's Text file encoding property to UTF-8:
After changing the PyDev default encoding, we now can display those German umlaut characters. We also updated the title to use the correct German ä character:
GUI_Refactored.py