autodetect character encoding instead of assuming ShiftJIS

Signed-off-by: James Rubingh <james@wrive.com>