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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cut and pasting from word

Status
Not open for further replies.

vasah20

Programmer
Feb 16, 2001
559
US
hey all -
i've got a small problem with people cut and pasting from Word documents into a textarea. I can already detect all the carriage returns, but I'm getting a problem with those bullet points and various " marks. They are being stored in my db as 0 with a line through it, or variations on that, while some of the " and ' are being stored as ASCII codes. Unfortunately, I'm taking this data and generating an RTF file from it, so the ASCII codes show up.

I was thinking about regexp-ing the input, but how can I know any/all of the possible combinations for bullets, or ASCII code, etc?

this seems like it would be a fairly common problem, so I was hoping that someone else has encountered this and defeated it.

TIA -

leo

------------
Leo Mendoza
lmendoza@garbersoft.net
 
Hi

You don't have to know all the codes of every bullet and o thorn (the name of that slash "o" character). The ASCII values for each character go from 1 to 255 but start from about 9 for a Tab, 10 is a carriage return, 13 is a line feed etc. So in theory you could loop though all the ascii values except the common ones such as 32 (space) and replace them with whatever character you wish. I would suggest you do this whilst creating your rtf file though as it could be quite intensive.

You can get full listings of ascii character values from loads of places on the web.

Derren
[The only person in the world to like Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top