Browse files

Recompile Regexp that may contain UTF-8 escapes. Fixes #2003.

  • Loading branch information...
1 parent 22ecbb6 commit 6eaadc12a2cfbb9785cec0b7bd9b4624dcb30320 @brixen brixen committed Dec 16, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 vm/builtin/regexp.cpp
View
6 vm/builtin/regexp.cpp
@@ -214,8 +214,10 @@ namespace rubinius {
if(enc == onig_data->enc) return true;
- pat = (UChar*)source()->byte_address();
- end = pat + source()->byte_size();
+ Encoding* source_enc = source()->encoding(state);
+ String* converted = source()->convert_escaped(state, source_enc, fixed_encoding_);
+ pat = (UChar*)converted->byte_address();
+ end = pat + converted->byte_size();
int options = onig_data->options;
OnigEncoding orig_enc = onig_data->enc;

0 comments on commit 6eaadc1

Please sign in to comment.