From: Mark Date: 2006-12-16T04:50:07+09:00 Subject: newb: Rails character encoding and validation I'm putting together a basic rails application, and writing my first units tests for it.. It occured to me that the user 'name' field might want to contain foreign characters (like �,�,�,�... etc.) But two problems have popped up. Firstly, I can't dig up a good reference for a suitable regular expression for validating the field. at the moment, I'm using: validates_format of :name, :with => /^[-' a-zA-Z]+$/ but this isn't going to allow the foreign characters, so the test fails. The second problem is the error message I get when I run the unit test: My test framework sets the name to Jos�, the the failure message when I run the script returns Jos�. It looks like the character encoding of my editor isn't the same as the character encoding that rails is using. so, a) any clues as to what is going on? and b) is there a consistent way of dealing with foreign characters for validation purposes? Many thanks in advance! Mark.