I have the feeling someone *will* run this function on a 500Mb string someday, so it might be a bad idea. :)
/ Mirar
Previous text:
2003-09-24 12:30: Subject: utf8_char_index
It would also be possible to generate a byte-offset -> index table when generating the UTF-8 from the widestring. Then it would be O(1), but it would use 4 bytes more memory for each byte.
/ Per Hedbor ()