a question about unicode in python

Evan Klitzke evan at yelp.com
Tue Jun 12 19:29:27 CEST 2007

On 6/12/07, hzqij <hzqij1978 at gmail.com> wrote:
> i have a python source code test.py
> # -*- coding: UTF-8 -*-

As Marc pointed out, you should test the actual file encoding of the
program to check that it is, in fact, UTF-8 encoded. If you're on a
Unix/Linux system you should be able to test for a UTF-8 encoded file
using the "file" command, e.g.

evan at dhcp-10-10-7-101 ~ $ file ~/uni.py
/home/evan/uni.py: UTF-8 Unicode text

Evan Klitzke <evan at yelp.com>

More information about the Python-list mailing list