Made the encoding of files consistent with how the library does it.