# MySQL lookups on VARCHAR with accents

**URL:** <https://www.ruby-forum.com/t/mysql-lookups-on-varchar-with-accents/147546>\
**Category:** Rails\
**Created:** [September 3, 2008, 1:36am UTC](https://www.ruby-forum.com/t/mysql-lookups-on-varchar-with-accents/147546 "2008-09-03T01:36:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeffrey\_LSTaylor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee7513/32.png) [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Post date:** [September 3, 2008, 1:36am UTC](https://www.ruby-forum.com/t/mysql-lookups-on-varchar-with-accents/147546/1 "2008-09-03T01:36:22Z")

</div>

I am running into problems with MySQL and lookups. The table has  
character  
set utf8, but:

mysql\> select id, token from tokens where token = ‘esta’;  
±------±------+  
| id | token |  
±------±------+  
| 83417 | está |  
±------±------+  
1 row in set (0.00 sec)

How do I configure things so MySQL doesn’t ignore accents?

TIA,  
Jeffrey

---

<div class="post-metadata">

**Author:** ![Jeffrey\_LSTaylor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee7513/32.png) [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Post date:** [September 3, 2008, 6:30pm UTC](https://www.ruby-forum.com/t/mysql-lookups-on-varchar-with-accents/147546/2 "2008-09-03T18:30:04Z")

</div>

On 3 Sep 2008, at 00:35, Jeffrey L. Taylor wrote:

> ±------±------+  
> 1 row in set (0.00 sec)
> 
> How do I configure things so MySQL doesn’t ignore accents?

Set the collation you want to use  
([http://dev.mysql.com/doc/refman/5.0/en/charset-collation-effect.html](http://dev.mysql.com/doc/refman/5.0/en/charset-collation-effect.html)  
)

Fred

---

<div class="post-metadata">

**Author:** ![Jeffrey\_LSTaylor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee7513/32.png) [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Post date:** [September 11, 2008, 1:23am UTC](https://www.ruby-forum.com/t/mysql-lookups-on-varchar-with-accents/147546/3 "2008-09-11T01:23:30Z")

</div>

Quoting Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> > ±------±------+

There were several problems adding noise, but the real problem is that  
there  
is a bug in FeedTools 0.2.26 and probably beyond. It converts numeric  
HTML  
entities under 256 to Latin-1 characters, even though the feed was  
UTF-8.  
MySQL truncates strings (VARCHAR) on the first invalid UTF-8 character.

Jeffrey
