|
Posted by Jerry Stuckle on 09/18/07 00:51
FFMG wrote:
> Sanders Kaufman;92237 Wrote:
>>> No, sorry I was actually talking about some non standard characters
>>> that MS Words inserts.
>>>
>>> Some bowser will, (maybe wrongly), not display any invalid
>> characters
>>> in the textarea itself giving the user the impression that
>> everything
>>> is fine.
>>>
>>> But when I then try to display the comment/entry I get a bunch of
>>> questions marks for the characters that were invalid.[/color]
>> Ah, so. You're having a character set problem.
>> Rather than have a big old off-topic thread about it here, you should
>> probably take the question to an Office or HTML group.
>> PHP won't help you much.
>
> No I am not, read the question again, carefully this time.
> Textareas of most browsers will, (wrongly), accept MS Word pasted
> code.
>
> By the time it gets to my server I have to clean it up.
> My PHP code must handle it.
>
> Is that on topic enough for you?
>
> FFMG
>
>
Yes, this has been asked before - but I don't remember what the answer was.
The easiest way would be to check for non-alphanumeric chars using a
regex. If you find any, tell the user to use plain text editor.
You could use a regex to strip non-alphanumeric characters, but this
might have some problems. For instance, what happens if you have a
control sequence which happens to contain a character - i.e. 0x010231?
The 0x42 would be taken as the character '1', even though it's part of a
control sequence. But you could clean it up fairly well this way.
Try googling this newsgroup for something like "MS WORD". It's been a
few months.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|