Forum Navigation
Translate utf16 indices to utf8 indices
Posted: 05/19/08 22:26:06I have an utf8 string and i want to call a windows api function that takes an utf16 string and returns a ascending sorted array of indices to that utf16 string. I need those indices translated to the utf8 string.
char[] str = something(); // the existing string wchar[] wstr = toString16( str ); int[] indices16 = WindowsFunction( wstr.ptr, wstr.length ); // something happends ... :) int[] indices8; // the resulting array of inidices to strHow can i do that in a nice, reliable and probably efficient way?
This should for the full unicode range.