--- In [email protected], "swzoh" <sean...@...> wrote:
>
> --- In [email protected], "brucexs" <bswitzer@> 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.
>

You are right that does save a couple of lines of code -- I uploaded a d6 which 
tries that approach.

(Actually, it was checking for second byte zero before the mlen check, since I 
just kept what was working before).

Reply via email to