fancy unicode strchr question
"Robert Buck" <[email protected]>
| Newsgroups | gmane.comp.lib.icu.general |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I have a question regarding writing a fancy strchr style routine.
Given a pointer to a ***huge*** buffer of characters, which is in local code
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
do {
streaming-based transcode from lcp to utf-16 into stack buffer
while idx < consumed && characterAt(++idx) != '\''
++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
connection.
Bob