httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: [PATCH] ap_xlate_* routine for SBCS to convert a char
Date Wed, 10 May 2000 02:51:17 GMT
On Tue, 9 May 2000, Jeff Trawick wrote:
> In some situations, the APR client "knows" that it is translating
> between a pair of SBCS character sets.  Having a lean function to call
> in this situation to translate a character makes for more readable
> code and a slight speed improvement over a function that would handle
> multibyte characters on input and/or output.
> 
> 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?

Is there actually a possible failure for a specific character? Or in other
words, can you do an up-front test for success/fail and then blindly
convert all characters? (without checking for errors)  That would toss the
ap_int32_t and error checks; it would be an unsigned char return (no
casting!) and no err checks.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/


Mime
View raw message