Bookmark Topic Watch Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
    Bookmark Topic Watch Topic
  • New Topic