Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
    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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis
  • Mark post as helpful
  • send pies
  • 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.

mooooooo ..... tiny ad ....
how do I do my own kindle-like thing - without amazon
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!