From: Roger Pack Date: 2010-02-25T02:56:56+09:00 Subject: Re: How do I set the encoding on a regexp ? > I was expecting both to be set to UTF-8. There is no force_encoding > method for RegExp. > > If I later try to use it on strings of type UTF-8, it can throw an > exception. Do you have an example of this? It might be a bug. I did notice that Regexp.new("Caf辿").encoding keeps it in UTF-8 so maybe it's optimizing it and when it doesn't "have to be" UTF-8 it is leaving it as ASCII? -r -- Posted via http://www.ruby-forum.com/.