# Validation on special characters

**URL:** <https://www.ruby-forum.com/t/validation-on-special-characters/108549>\
**Category:** Rails\
**Created:** [July 4, 2007, 4:33pm UTC](https://www.ruby-forum.com/t/validation-on-special-characters/108549 "2007-07-04T16:33:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![clemrock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c57346/32.png) [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Post date:** [July 4, 2007, 4:33pm UTC](https://www.ruby-forum.com/t/validation-on-special-characters/108549/1 "2007-07-04T16:33:19Z")

</div>

Hello,

```
I'm trying to make a validation that catches special latin chars 

```

that  
cause Mysql errors.

Here’s what I’ve been trying so far:

validates\_format\_of :title, :with=\>/\A[^#]/, :message=\>‘must not start  
with  
a “#”’, :if =\> Proc.new {|page| page.title && page.title.size \> 0 }

validates\_exclusion\_of :title, :in =\> ‘Ï€ â‰¤ â‰¥ âˆ« âˆš â‰ˆ Î© âˆž â‰ âˆ‘ âˆ‚ âˆ† Ë™ Ëš’,  
:message =\> “Title contains invalid characters”

When I throw these characters into the textfield, they aren’t dectected  
and  
the sql error is thrown.

–  
View this message in context:  
[http://www.nabble.com/Validation-on-special-characters-tf4024691.html#a11431779](http://www.nabble.com/Validation-on-special-characters-tf4024691.html#a11431779)  
Sent from the RubyOnRails Users mailing list archive at [Nabble.com](http://Nabble.com).
