Changed open() to codecs.open()

For windows compatibility.