> 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/.