Fix UTF-8 bug in NSString_RegEx
commit3324591e6cb3af729bad654b1772e3bc34d2986e
authorPieter de Bie <pdebie@ai.rug.nl>
Mon, 14 Sep 2009 11:02:36 +0000 (14 13:02 +0200)
committerPieter de Bie <pdebie@ai.rug.nl>
Mon, 14 Sep 2009 11:25:01 +0000 (14 13:25 +0200)
treee6d03741ba937feb546c9f7cdf7ccaaa57358f2d
parent4544816ac85411b99cdd20746ad70ae3c58638c5
Fix UTF-8 bug in NSString_RegEx

This class would use the location information provided by
regex(3) as range for for a substring. However, the information
regex(3) returns is a byte-based, while NSString works on characters.

This can cause a problem when there are UTF-8 characters in the string,
as the wrong subsstring will be returned.

This is fixed by taking the UTF bytesequence, and extracting a substring
from that, rather than using NSString's own substring method
NSString_RegEx.m