Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript replace() doesn't work in VS - unknown character

I'm trying to use the javascript replace function to replace curly quote with straight quotes:

var EditedContent = content.replace(/“/g, '"');

This works great in a little proof of concept html file I've whipped up, but when it's in a visual studio project, it replaces the curly quote with a symbol that suggests 'unknown character':

Unknown character

How can I resolve this issue so that I can use the application properly when debugging?

like image 201
splatto Avatar asked Feb 08 '10 16:02

splatto


1 Answers

Use unicode:

... = content.replace(/\u201C/g, '"');

You can find unicode equivalents of various quotes here.

like image 123
Eric Wendelin Avatar answered Sep 25 '22 02:09

Eric Wendelin