Reply to Best way to encode?

Your name:

Reply:


Posted by Brian Dunning on 01/19/05 19:58

I have a form where people input some text, which is then incorporated
into an HTML snippet which appears in a textarea for them to copy &
paste into a web page.

People will be entering foreign language stuff as well as special
characters like copyright, so I have to be sure this is handled
properly.

I tried rawurlencode() but that results in HTML which displays the
encoding when they paste it into their web page. I tried htmlentities
but that gives different characters than what they typed when displayed
in the textarea. I also tried no encoding, which worked well, except
that it gets messed up when I try to write it to the database and I
have the same problem again when retrieving it.

"Cañon ©" is a good example.
htmlentities('Cañon ©') -> Cañon © in the textarea, displays on their
web page as Cañon ©

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация