When a segment of text is copied-and-pasted from
Word (or other word processing packages), frequently the quote characters will not appear correctly in web pages. That is because these programs do not use ASCII quote characters, but rather "smart quotes" where the opening and closing quote characters are not the same.
If you are the one doing the cutting-and-pasting, you can either turn off this feature in Word or replace the "bad" characters by hand.
But if you need to deal with this issue programatically, William Brogden has supplied the following code fragment where
s is the
String to be "fixed":
William notes that a faster solution is possible, but this example sacrifices that for readability.
JspFaq