Fixing encoding of file contents.

The file routines use percent encoding when passing text files to
javascript.  Percent encoding doesn't escape single quotes, so we
need to enclose the encoded string within double quotes.