[Rails] Validating Umlauts

Adam Groves
Tue, 10 Jan 2006 08:34:25 -0000

Hi there,

I''m building a rails application for German and English speakers.
However, I''m having some problems validating German-specific characters
(????). I have a tag-model which validates format of :name, :with =>
/^\w+$/. This throws an exception if german characters are used. My
tables are all utf-8 and my environment.rb has the lines

$KCODE = ''u''
require ''jcode''

to set the character set to utf-8. Funnily enough, if I comment out the
tag validation and add a new tag, an new row is created but the field
tags.name is blank if the name includes ? ? ? or ?.

I''d be grateful if anyone could offer me some advice.

--
Posted via http://www.ruby-forum.com/.