Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 98869 invoked by uid 500); 10 May 2000 14:51:31 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 98858 invoked from network); 10 May 2000 14:51:31 -0000 Date: Wed, 10 May 2000 10:51:43 -0400 Message-Id: <200005101451.KAA01210@k5.localdomain> X-Authentication-Warning: k5.localdomain: trawick set sender to trawickj@bellsouth.net using -f From: Jeff Trawick To: new-httpd@apache.org In-reply-to: (message from Greg Stein on Wed, 10 May 2000 01:36:55 -0700 (PDT)) Subject: Re: [PATCH] ap_xlate_* routine for SBCS to convert a char Reply-to: trawickj@bellsouth.net References: X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N > > > > 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, http://www.lyra.org/ Have fun, Jeff