Changes:
- convert replacement from UTF-8 to UTF-16 (before processing)
- copy (strdup) UTF-16 version of suject as result (before processing)
- convert back result from UTF-16 to UTF-8 (before returning)
- we directly work on UTF-16 code unit offset (internal for replacements)
real 0m0.022s user 0m0.018s sys 0m0.004s
real 0m18.278s user 0m18.261s sys 0m0.010s
real 0m0.093s user 0m0.085s sys 0m0.008s
real 17m4.348s user 16m59.614s sys 0m4.092s
Changes:
- we don't need to convert replacement in UTF-16
- copy (strdup) UTF-8 version of suject as result (before processing)
- result is already in UTF-8 (before returning)
- we need to convert length in code points (UTF-16 => UTF-8 to map offsets) (internal for replacements)
real 0m0.022s user 0m0.014s sys 0m0.008s
real 0m21.291s user 0m21.263s sys 0m0.015s
real 0m4.960s user 0m4.951s sys 0m0.006s
too long (more than 13h ?)