reading utf-8 file in Python

import codecs
fp = codecs.open(fileName, "r", "utf-8")
fp.read()

* http://evanjones.ca/python-utf8.html
* http://www.jorendorff.com/articles/unicode/python.html

Tags: ,

Comments 2

  1. Tom Goren wrote:

    I think you meant

    codecs.open

    instead of codes.open

    Thanks!

    Posted 09 Oct 2009 at 3:18 pm
  2. dryice wrote:

    oooops… Thanks Tom!

    Posted 22 Oct 2009 at 1:35 pm

Post a Comment

You could use <code type="name"> to get your code colorized

Your email is never published nor shared. Required fields are marked *

Close
E-mail It