• Post Reply Bookmark Topic Watch Topic
  • New 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
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

windows word double quotes turning into boxes

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a form that has a text area where users can paste content or type in. I have set content type in the page directive as :
so that I receive text without funny characters (like ? etc) when users paste content from MSWord also. The pageEncoding and contentType setting are working fine for characters like bullets etc but failing for double quotes and turning into boxex when I display the text back to the browser. I am not sure about doing anything more.
Any help is greatly appreciated.
Regards
Prakash
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like those damn Microsoft "smart quotes" are at it again. Man! I hate those things. You are going to have to replace the "smart quotes" with legal quote characters before echoing the text back. Unfortunately I can't remember what the hex values are so you are going to have to dump all the characters of an example string as hex (or decimal) to find out.
Bill
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Prakash
Actually i could'nt understand yr problem , can you send your jsp code or some details
Manish Sharma

Originally posted by Prakash Gorthy:
Hi,
I have a form that has a text area where users can paste content or type in. I have set content type in the page directive as :
so that I receive text without funny characters (like ? etc) when users paste content from MSWord also. The pageEncoding and contentType setting are working fine for characters like bullets etc but failing for double quotes and turning into boxex when I display the text back to the browser. I am not sure about doing anything more.
Any help is greatly appreciated.
Regards
Prakash

 
Sheriff
Posts: 67554
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Actually i could'nt [sic] understand yr [sic] problem , can you send your jsp code or some details


Not necessary as William has already completely addressed the problem.
bear
P.S. 3 jobs ago I was bitten by this when a tech writer wrote all the help content in Word, and then the text was cut-and-pasted into the JSP pages. Finding all those nasty "smart" characters was a pain in the royal derriere. And at the time we were using JRun whose JSP parser barfed its guts out when it encountered one of these. What good family fun!
[ July 10, 2003: Message edited by: Bear Bibeault ]
 
Prakash Gorthy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the sample code of the jsp i am using. Currently i am searching for the hex values of the "smart quotes" of word.
If any one can point me to them it will be a great help.
Regards
Prakash

(My actual use is to store the entire content into mysql database and later on show it up when user request it.
I am mimiking the database writing and reading using streams.)
 
Prakash Gorthy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After a small check to see the int values of these ms word fancy characters i found out that the smart quote values are 8220,8221.
Instead of conveting the text I am receiving from request parameter to uft-8, i am now calling a small bean which accepts a string looks for smart quotes and smart dashes and replaces them with normal quotes and dashes.
here is the method I am using but wondering is this the only way or any other better way?

Note: when list items in word document are pasted they as well turn up to be boxes with int value 61623 (getting displayed as ?) which i am ignoring at this moment.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic