newbie qusetion, about unicode.

    I'm a beginner to Rails.
I has a problem about unicode when I tried some example code like


I haven't sorted out all UTF-8 yet, but I've learned that you need to add this to the top of the environment.rb file:


Also, be sure to use Rails' Multibyte API when working with UTF8 strings.

I don't know if these will solve all your needs, but it's the place to start.

Thanks Greg,

I thikn the problem is, the

@files = Dir.glob(’*’)

got strings that is not in UTF-8 encoding, and the I tried to trade them as UTF-8. There may needs conversions.

BTW, is


the same as