Bharat Ruparel wrote in post #959309: > This works for me and is consistent with my observation. Rails does set > a default encoding in one of the files config/application.rb as shown > below: > > # configure the defaulting encoding used in templates for Ruby 1.9 > config.encoding = "utf-8" > > It seems like the seeds.rb file which is conventionally used to > initialize data is unaware of this setting. Further, it seems like that > is not what the Rails team intended. As the comment says, that setting is used for templates, but seeds.rb is ruby source code. When you read a ruby 1.9 source file using load() or require(), then the encoding is always forced to US-ASCII unless you tag it with a #encoding. That is actually a sane default - imagine what would happen if the same source file were parsed differently depending on what system it ran on (*). It gets more complex if instead of using load() or require(), you read the file into a String and then eval() that String. In that case, the encoding of the String is used as the source encoding, unless overridden by a #encoding line. Regards, Brian. (*) However, the same program may still behave differently on different systems, even if parsed identically. This is because the default is to allow the environment to decide the encoding of data files. You need to explicitly override this if you want your program to behave in a sane fashion, and that's what Rails is doing: whenever it reads a template, it applies its own config.encoding setting instead of letting Ruby pick an (essentially arbitrary) encoding. -- Posted via http://www.ruby-forum.com/.