Search code examples
pythonutf-8characterencode

print "Düsseldorf" with Python


I am trying to use the string Düsseldorf. When I do that :

# -*- coding: utf-8 -*-
print "Düsseldorf"

it prints strange characters. Could anyone help me please ?

Thank you very much.


Solution

  • >>> print u"Düsseldorf"
    Düsseldorf
    

    "Unicode In Python, Completely Demystified"