--- In [email protected], "brucexs" <bswit...@...> wrote: > > I don't want to overcomplicate things. It only checks after finding a lead > byte, and if the combination of that lead byte and next byte is not valid > dbcs pair, then it replaces both by a blank. >
I didn't mean to make things complicated, on the contrary, I think it makes the job simpler. With the current implementation, when mblen returns -1, always have to check first if the second byte is NULL. But, if only first byte is dropped/replaced, don't have to. Automatically we will get 0 at the next test. So, the routine would be almost identical for both the DBCS & SBCS, except when mblen returns 2.
