Fix encoding issue #134 with backwards compatibility to ST2

Use codec.open for ST2 compatibility.