NYCPHP Meetup

NYPHP.org

[nycphp-talk] Charsets are still driving me nuts

Bob/Jules bob.siegel at verizon.net
Wed Feb 27 00:19:23 EST 2008


I am new to PHP, but I did two CMS systems in ColdFusion, so I can give you the approach I used.

Enter each "funny" character into the form and save the field (textareas in mine).
Then see what binary character(s) come back.
Then code to replace them with more conventional characters, or the html &---; codes in your app.

Attached is the zipped CF routine which might help tho you can't use it directly.
BTW, "&" in CF is for concatenation (. in php).

This problem drove also crazy for a while as the users were pasting not from Word, but from Pagemaker or something.  To add to it, I got different returned char(s) on the production server than on my box at home, which is why there are TWO sets of CF Replace()s.

Good luck!


>Charsets are still driving me nutsI have been validating textareas using ctype_print; however, I am starting to get user errors. It’s amazing how many people cut and paste from MS Word. So what appears to be simple text and a reasonably valid string actually contains stuff that ctype_print does not like.
>
>Does anyone use this function? Any better ideas for validating general text areas? Just use the php filter function sanitizing control characters? Other ideas for validation and dealing with cut ‘n paste user input?
>
>
>
>_______________________________________________
>New York PHP Community Talk Mailing List
>http://lists.nyphp.org/mailman/listinfo/talk
>
>NYPHPCon 2006 Presentations Online
>http://www.nyphpcon.com
>
>Show Your Participation in New York PHP
>http://www.nyphp.org/show_participation.php


Robert Jules Siegel
ColdFusion and PHP Web programming
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FUNNIES.ZIP
Type: application/octet-stream
Size: 687 bytes
Desc: not available
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20080226/a8cebdd7/attachment.obj>


More information about the talk mailing list