javascript I/O with ANSI/UTF-8