NYCPHP Meetup

NYPHP.org

[nycphp-talk] Charsets are still driving me nuts

Rob Marscher rmarscher at beaffinitive.com
Wed Feb 27 17:23:11 EST 2008


On Feb 26, 2008, at 5:46 PM, Cliff Hirsch wrote:
> I 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?

Are you using utf-8 encoding?  What do you need to validate/sanitize  
with the textareas?  That the input is using the correct character  
set?  Need to strip html from it?  I've had pretty good luck with  
using utf-8 and having text cut and pasted from MS Word come through  
fine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20080227/6094ac53/attachment.html>


More information about the talk mailing list