Click to See Complete Forum and Search --> : special chars in textarea


tbirnseth
07-16-2007, 12:41 AM
I had vailed to catch the place where I assigned the original POST. Special chars don't show after they're posted again, but at least it works.

I'm trying to provide a very light editor... Goal is that someone can type in some html and then preview it in a div lower in the page. I.e. generate a short letter to be sent in html email.

The text area seems to barf on some special characters. I.e.  , etc. Other's, it leaves alone. The div ends up with non-ascii characters in it as well.

I've tried various combinations of PHP's stripslashes/htmlentities, etc. (testing on php 4 where magic_quotes is on) but always end up with one weird result or another. Either the textarea editing window looses the special chars, or the preview window ends up with lots of little diamonds with question marks in the middle of them (some kind of character interpretation).

So is there a clean way to collect html in a textarea and the display it in a div after a POST?

Getting frustrated....

Thanks for any help/insight you can provide.

Major Payne
07-16-2007, 11:24 PM
To find your own post, use the search function or click on your Username and select Find all posts by Your_UserName. You may have been answered already in original post on this topic.

Ron

foxbeefly
07-26-2007, 04:51 AM
What character-set are you using in your declaration (if any) ?

Something like:
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />

tbirnseth
07-26-2007, 08:27 AM
UTF-8

It is/was a PHP get_magic_quotes_gpc() issue.... PHP is trying to be too helpful.

tony