How to do it...

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:

We can, of course, always resort to the direct representation of Unicode.

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

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.82.21