comment imprimer des mots chinois dans mon code .. en utilisant python

C'est mon code:

print '哈哈'.decode('gb2312').encode('utf-8')

...et il imprime:

SyntaxError: Non-ASCII character '\xe5' in file D:\zjm_code\a.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

Comment puis-je imprimer "哈哈'?

Mise à jour: Lorsque j'utilise le code suivant:

#!/usr/bin/python
# -*- coding: utf-8 -*-

print '哈哈'

... il imprime 鍝堝搱. Ce n'est pas ce que je voulais obtenir.

Mon IDE est Ulipad, est-ce un bug avec l'IDE?

Deuxième Mise À Jour:

Ce code affichera les caractères à droite:

#!/usr/bin/python
# -*- coding: utf-8 -*-


print u'哈哈'.encode('gb2312')

...et quand je l'utilise:

#!/usr/bin/python
# -*- coding: utf-8 -*-

a='哈哈'
print a.encode('gb2312')
Traceback (most recent call last):
  File "D:\zjm_code\a.py", line 5, in <module>
    print a.encode('gb2312')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal not in range(128)

...ou...

#!/usr/bin/python
# -*- coding: utf-8 -*-

a='哈哈'
print unicode(a).encode('gb2312')
Traceback (most recent call last):
  File "D:\zjm_code\a.py", line 5, in <module>
    print unicode(a).encode('gb2312')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal not in range(128)

...il ne fonctionne pas. Comment puis-je imprimer la variable a de manière appropriée?

grâce

source d'informationauteur zjm1126