From: David Springer Date: 2010-02-25T06:43:27+09:00 Subject: Re: How do I set the encoding on a regexp ? Perry, In 1.9 there is only one optional parameter. You can force the encoding of the string parameter (if needed) AND also pass the options parameter. Try this: #!/usr/bin/env ruby s = "string" puts s.encoding r = Regexp.new(s.encode("utf-8"), Regexp::ENC_UTF8) puts r.encoding Here is the output: US-ASCII UTF-8 -David -- Posted via http://www.ruby-forum.com/.