Copy-and-Pasting problem from MS Word

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
EricS
Forum Contributor
Posts: 183
Joined: Thu Jul 11, 2002 12:02 am
Location: Atlanta, Ga

Copy-and-Pasting problem from MS Word

Post by EricS »

I have a couple of clients who use my applications and they insist on typing out data that goes in my forms in Word first, mostly for the spelling and grammar check I'm betting, and then copy-and-pasting the data from MS Word into my forms.

Most of the time, everything works fine. Occasionally they will copy a character from Word that uses a character encoding that PHP doesn't like. In these instances, the character is stored as a decimal entity, such as ‟ Now before I output anything to the screen, ESPECIALLY user input, I htmlentities() the data first. This causes the leading & to be changed to & with causes an ugly string to show on the screen.

Anyone else having this problem and if so, how are you getting around it?

Thanks,
EricS
Post Reply