Refs #1652 Encoding the JS output for making map work in languages with single quotes in strings, eg. French