#!/usr/bin/env python
# -*- coding: utf8 -*-
print "私"
print u"私"
the result:
ç§
UnicodeEncodeError: 'ascii' codec can't encode character u'\u79c1' in position 0: ordinal not in range(128)
Or, in Idle for both u"私" and "私":
>>> print "私"
Unsupported characters in input
I've followed all the advice I could find which says that I have to put the "coding" line under the shebang. All my web-browsers display kanji fine, and I can type it fine. But this garble comes out when I try and use it in Python :( Any ideas?