httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: Apache::Request, APR::Table and UTF8
Date Wed, 06 Oct 2004 00:42:33 GMT
David Wheeler wrote:
> On Oct 5, 2004, at 4:55 PM, Stas Bekman wrote:
>> What you and Boris say makes perfect sense, but we certainly don't 
>> want to try to support all possible formats out there and try to 
>> handle those on behalf of users. If we do we may need to spawn 
>> APR::Table to be a project on its own with its own dedicated 
>> developers team. this is something suitable for Apache::Request which 
>> deals with a sub-set of formats, it's not suitable for APR::Table 
>> which is a general purpose thing.
> Yes, I'm not talking about remembering what character set a string is 
> in, only about preserving the value of the Perl utf8 flag.

OK, how about this idea: reserve the first char for a perl flags only, so 
if I have:

perl -MDevel::Peek -le '$x = "\x{f6}\x{e4}\x{fc}"; Dump $x'
SV = PV(0x804cef8) at 0x80656d8
   REFCNT = 1
   PV = 0x805f540 "\366\344\374"\0
   CUR = 3
   LEN = 4

sv_flags are:

struct STRUCT_SV {		/* struct sv { */
     void*	sv_any;		/* pointer to something */
     U32		sv_refcnt;	/* how many references to us */
     U32		sv_flags;	/* what we are */

so it won't fit in one char, which is only 8 bit. Should we want to store 
any other perl flags other than UTF8?

Notice that my proposal is different from Joe's since I don't suggest to 
deal with charsets, but only preserve certain bits from the perl flags as 
Boris and David suggest.

Will that create a mess for Apache::Request table subclass Joe?

So on get() the SvPV will point to the 1st char instead of 0th, and the 
added overhead will be to allocate one more char, and set it at create 
time and read it and adjust the SV flag on get.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

View raw message