Convert string to Unicode before matching with regexp.
This approach works well for all encodings except those that are currently not supported by ruby.