httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject Re: [PATCH] ap_xlate_* routine for SBCS to convert a char
Date Wed, 10 May 2000 14:51:43 GMT
> > > > ap_xlate_conv_byte() takes a single-byte character as input and
> > > > returns either the single-byte translated character or -1 (can't
> > > > convert).  It doesn't return ap_status_t because that would spoil the
> > > > interface.
> > > 
> > > Is it important to have a buffer conversion, rather than one character at
> > > a time?
> > 
> > I don't know what you mean.
> Sorry. I meant, would it be a good thing to have a function to translate
> an entire SBCS buffer in one shot, rather than a function to do a single
> character at a time? IOW, move the loop into the function, rather than
> outside.

I definitely don't intend to use ap_xlate_conv_byte() in a loop (or at
least not in a loop that only does ap_xlate_conv_byte() :) ).

I agree with you regarding the usefulness for a function to translate
an entire SBCS buffer in one shot.  Such a function would be a tiny
bit faster but more importantly the client code would be a little
simpler/more readable and its SBCS restriction would be more
self-documenting.  On the other hand, the current
ap_xlate_conv_buffer() doesn't impose too much extra overhead on an
SBCS-limited client, so I haven't (yet) felt a strong need to
implement such a function (ap_xlate_conv_bytes()?).  Maybe I'll never
reach my threshold and somebody else will beat me to it.

> > > Is there actually a possible failure for a specific character? 
> > 
> > What happens when translating from US-ASCII (whatever 7-bit ASCII is
> > called) to some other character set when the input character is 0xF0?
> > The input is invalid, but I don't know when it might be recognized as
> > an error.
> Gotcha. This question was more for my own edification. If there *wasn't* a
> potential error, then some additional optimizations could be performed.
> But seeing that one could occur... right.
> >... [issues with errors in the conversion] ...
> > Hmmm... more thought required...
> Okily dokily. Your call; I just wanted to ask the question. You're the man
> :-)
> Cheers,
> -g
> -- 
> Greg Stein,

Have fun,


View raw message