Fix encoding of string against which a Regex is matched

We noticed that regex matches against strings containing accented characters ended up causing infinite loops on some machines. In the end it turned out on those machines Java wasn't using UTF-8 as the default charset (e.g. the one you can specify through -Dfile.encoding). Looking at the code I realized that the pattern were always encoded in UTF-8 but the strings were using the default charset. Forcing UTF-8 there too fixes the problem.

I can't figure out how I could write a test for that, as it requires passing a special VM argument, so in the end I did nothing.