# Little bug in search\_behaviour when using UTF-8

**URL:** <https://www.ruby-forum.com/t/little-bug-in-search-behaviour-when-using-utf-8/101113>\
**Category:** Radiant CMS\
**Created:** [August 3, 2006, 1:01pm UTC](https://www.ruby-forum.com/t/little-bug-in-search-behaviour-when-using-utf-8/101113 "2006-08-03T13:01:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruben\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f07891/32.png) [@Ruben\_N](https://www.ruby-forum.com/u/Ruben_N)\
**Post date:** [August 3, 2006, 1:01pm UTC](https://www.ruby-forum.com/t/little-bug-in-search-behaviour-when-using-utf-8/101113/1 "2006-08-03T13:01:32Z")

</div>

To Oliver B.:

I’ve found a little but annoying bug in search\_behaviour:  
A Rails exception raises when using any UTF-8 character in the  
querystring (Ã?, Ã, for instance) which it’s especially noticeable  
when using the “live search” approach.

This is easily fixed by using “encodeURIComponent” instead of  
“escape” (the former is what scriptaculous uses too)  
More about this issue here: [http://blog.openboxsoftware.com/2006/04/](http://blog.openboxsoftware.com/2006/04/)  
javascript-escape-vs-encodeuricomponent/

I’ve attached a patch with the fix.

ï¿¼

Cheers,

Ruben N.  
[www.leftbee.net](http://www.leftbee.net) – Personal Blog
