encoder: add javascript mode for strings