473,382 Members | 1,392 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Copy and paste unreadable characters

We have a web page where application users are coping and pasting some
text from WordPerfect or MS Word. We have noticed some of the
characters are unreadable. These characters have special formating on
them from the word processing application. For instance one has the
Trademark symbol which is a small tm but contains some special
formating. When this is pasted it doesn't render correctly as the
browser doesn't understand the character. We are using IE 6.0.2.
Also they have double quotes that when pasted are very different then
if I typed them in. I am looking for some javascript code that could
replace this or stip it out. Does anyone know of a regular expression
that might do this? Or maybe an alternative idea?

Thanks in Advance,
Tom

Aug 16 '06 #1
3 3139
to************@gmail.com wrote in news:1155735173.510428.123320
@m73g2000cwd.googlegroups.com:
We have a web page where application users are coping and pasting some
text from WordPerfect or MS Word. We have noticed some of the
characters are unreadable. These characters have special formating on
them from the word processing application. For instance one has the
Trademark symbol which is a small tm but contains some special
formating. When this is pasted it doesn't render correctly as the
browser doesn't understand the character. We are using IE 6.0.2.
Also they have double quotes that when pasted are very different then
if I typed them in. I am looking for some javascript code that could
replace this or stip it out. Does anyone know of a regular expression
that might do this? Or maybe an alternative idea?
Server-side code to filter the bad characters out of the input text and
replace them with HTML-friendly characters. Your server does have
scripting languages, doesn't it, like php, asp, or cfm?
Aug 17 '06 #2
Jim Land (NO SPAM) wrote:
to************@gmail.com wrote in news:1155735173.510428.123320
@m73g2000cwd.googlegroups.com:
We have a web page where application users are coping and pasting some
text from WordPerfect or MS Word. We have noticed some of the
characters are unreadable. These characters have special formating on
them from the word processing application. For instance one has the
Trademark symbol which is a small tm but contains some special
formating. When this is pasted it doesn't render correctly as the
browser doesn't understand the character. We are using IE 6.0.2.
Also they have double quotes that when pasted are very different then
if I typed them in. I am looking for some javascript code that could
replace this or stip it out. Does anyone know of a regular expression
that might do this? Or maybe an alternative idea?

Server-side code to filter the bad characters out of the input text and
replace them with HTML-friendly characters. Your server does have
scripting languages, doesn't it, like php, asp, or cfm?
We are using JSON with Java on the server. Normally I would try to do
this on the server as my Java skills are stronger than my JavaScript
skills. The problem is I need to clean out these characters before we
hand it off to JSON or else the data doesn't get to the server.

I tried doing things like

description = description.replace( /\\ /g,"");

But that didn't work.
Thanks,
Tom

Aug 17 '06 #3
I finally found this code to remove unreadable characters. It leaves
the special character needed.

replace( /[^\w\.(){}\];?!@#$\^%&*-\\:~`\"-]/g," ")

Thanks,
Tom

Aug 23 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Petter L | last post by:
I getting the following message when using Filecopy command An unhandled exception of type 'System.NullReferenceException' occurred in Unknown Module. Additional information: Object...
0
by: **Developer** | last post by:
I need to copy some text to the clipboard so that Word can paste it. The text contains characters that have no ANSI equivalent. If I simply put the text on the Clipboard, Word displays these...
9
by: (Pete Cresswell) | last post by:
I see this coming on a develpment effort that may materialize shortly. These guys don't want to mess around with automated imports from text feeds BC in the past they've had too many problems...
4
by: Legendary Pansy | last post by:
I was checking out the 101 C# Samples, specifically Windows Forms - Use the Clipboard. I took a look at the code for a while, and I understand what the program is doing with the cut, copy, pasting...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
0
by: NetronProject | last post by:
My copy/paste operation results in a MemoryStream full of '\0' characters on the Clipboard. Maybe my approach to copy/paste is wrong when handling generic types. All entries in the CollectionBase...
17
by: Steve | last post by:
I'm trying to code cut, copy, and paste in vb 2005 so that when the user clicks on a toolbar button, the cut/copy/paste will work with whatever textbox the cursor is current located in (I have...
0
by: abcd | last post by:
I have a wxTextCtrl: wx.TextCtrl(self.myPanel, -1, "", style=wx.TE_MULTILINE) I take a set of text (65,000 characters), and paste it into the text control. all looks well. Then when I click...
5
by: phill86 | last post by:
Hi I have a main form that holds records for scheduled meetings, date time location etc... in that form i have a sub form that has a list of equipment resources that you can assign to the meeting in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.