Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS word char set problem.

Status
Not open for further replies.

scotth4v

Programmer
Apr 17, 2001
103
0
0
US
Hi Gang, I have a bugtracker built using servlets/xml/xsl. Anyway, I have a problem: when people cut and paste out of an MS Word document into the description field, certain characters get translated into weird characters. For example: If I were to type Scott's "test" in Word, then cut & paste that into the text box, it would be saved as "Scottâ??s â??testâ??"

This is bad. The app sends out e-mail alerts when bugs are assigned, and if they happen to contain this char set, the email reads:

"This message uses a character set that is not supported by the Internet Service. To view the original message content, open the attached message. If the text doesn't display correctly, save the attachment to disk, and then open it using a viewer that can display the original character set. "

Any thoughts, ideas?

Thanks!

-Scott

Scott’s “test”

 
I too have come across this problem before - unfortunatley it is due to MS word using different characters (eg the 66 99 characters instead of the normal double quotes ""). The only way i found to resolve this problem was by going through my string and replacing these characters. Not pretty but effective.

The following are the replacements i used

line = line.replace('\u201C', '"');
line = line.replace('\u201D', '"');
line = line.replace('\u2013', '-');
line = line.replace('\u2018', '\'');
line = line.replace('\u2019', '\'');

hope this helps
 
Great! Thanks for the info, I'll give it a try! On a side note, do you know of a reference somewhere that lists charcode values like that?

Thanks again!

-Scott
 
Under the start menu go to
Programs
Accessories
System Tools
Character Map

One you have selected a character the unicode is displayed in the bottom left hand corner.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top