From: George Rhoten <grhoten@us...> - 2003-07-28 19:43:06
I'm presuming that you're using the ucnv_* API and not some other ICU API.
With the converter API, you can use an offset array. Between each
conversion you can accumulate the overall offset. See the API reference
IBM Globalization Center of Competency/ICU San Jose, CA, USA
"Robert Buck" <rbuck@...>
Sent by: icu4c-support-admin@...
07/28/2003 09:07 AM
To: "Icu4c-Support" <icu4c-support@...>
Subject: fancy unicode strchr question
I have a question regarding writing a fancy strchr style routine.
Given a pointer to a ***huge*** buffer of characters, which is in local
page, find the offset in the buffer where a '\'' (single quote) character
exists. Do not allocate any memory to perform the search, but use a stack
based buffer (streaming style approach).
Doing something like the following will not work (or so I suspect):
[in] buffer length
[in] source buffer
create stack based buffer
streaming-based transcode from lcp to utf-16 into stack buffer
while idx < consumed && characterAt(++idx) != '\''
} while (more to consume)
The problem is, how do you correlate positions in the source buffer with
positions in the destination buffers? I'm not sure how to make that
icu4c-support@... - icu4c-support mailing list