Stas Bekman wrote: > Boris Zentner wrote: > [...] > > So you suggest that APR::Table should always look at the perl variable > before it stores it, and store the PV string as is if UTF8 flag is not > set, otherwise encoded it into a utf8 string and only then store it. > That way no data will ever get corrupted. > > On return it should always return a PV with the utf8 string, w/o setting > UTF8 flag (and doing any further conversion). A user that will want to > do the conversion will do that on their own. > > In other words (using the Dump entries from your original example), if > APR::Table gets: > > SV = PV(0x1a48774) at 0x1a5b7a4 > REFCNT = 1 > FLAGS = (PADBUSY,PADMY,POK,pPOK) > PV = 0x2b67550 "\366\344\374"\0 > CUR = 3 > LEN = 4 > > it stores "\366\344\374"\0 as is. If it gets: > > SV = PVMG(0x1b17300) at 0x1a48afc > REFCNT = 1 > FLAGS = (PADBUSY,PADMY,POK,pPOK,UTF8) > IV = 0 > NV = 0 > PV = 0x2b67cc0 "\303\266\303\244\303\274"\0 [UTF8 "\x{f6}\x{e4}\x{fc}"] > CUR = 6 > LEN = 7 > MAGIC = 0x2b67310 > MG_VIRTUAL = &PL_vtbl_utf8 > MG_TYPE = PERL_MAGIC_utf8(w) > MG_LEN = 3 > > it decodes "\303\266\303\244\303\274"\0 into "\366\344\374"\0 and > stores the latter. > > When APR::Table gives back the perl variable it should always return it as: > > SV = PV(0x1acd900) at 0x1a5d484 > REFCNT = 1 > FLAGS = (PADBUSY,PADMY,POK,pPOK) > PV = 0x2b671d0 "\366\344\374"\0 > CUR = 3 > LEN = 4 > > Is that correct? I think we could do that.
gak. I don't know about this. as you pointed out earlier, I think apache tables are really for storing simple string data. all of this logic surrounding inserts and whatnot really seems inappropriate, despite the current bug/feature when it comes to utf8 data. before we go ahead with this I'd really like to get some more opinions on it. for instance, if joe and joe could weigh in specifically on this issue (whether the intent of apr_table_t was to hold anything more than simple strings) that would be great :) --Geoff --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]