fix for 0.8 which only supports string encodings, not opts.encoding
0.2.1