replacement = replacement.convertToUnicode(env, encoding);
subject = subject.convertToUnicode(env, encoding);
//XXX: option
Eregi regexp = RegexpModule.createEregi(env, pattern);
Value val = RegexpModule.eregi_replace(env, regexp, replacement, subject);
return encodeAll(env, val, encoding);
}