That's a hacky fix without an explanation.<br><br>Explain to me which layers/modules want SvUTF8 strings, which don't, and where the malformed conversion is happening, and then let's do a small, surgical fix. Not a massive "use bytes" hammer at the top that might fix it but might break something else that was expecting SvUTF8 scalars. (perhaps libxml in the XML stream to users, for instance, or libxml parsing itself....)<br>
<br><div class="gmail_quote">On Fri, Jan 23, 2009 at 12:48 AM, Aleksey Luzin <span dir="ltr"><<a href="mailto:subscr@p34.net">subscr@p34.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
Is this issue still exists ?<br>
I have fixed russian nicknames corruptions by adding string<br>
use bytes;<br>
in module IQ.pm<br>
<div><div></div><div class="Wj3C7c"><br>
On Friday 26 September 2008 19:25:49 Michael Scherer wrote:<br>
> Le samedi 22 septembre 2007 à 20:56 +0000, Brad Fitzpatrick a écrit :<br>
> > A perl program has to use Perl's UTF8 scalars everywhere, or nowhere,<br>
> > otherwise introducing them (as this patch does) starts the contagious<br>
> > spread of them... whenever one touches a non-UTF8 scalar, perl starts<br>
> > converting the one that's touched.<br>
> ><br>
> > I imagine we do use it, though, as XML libraries tend to use it?<br>
> ><br>
> > So this _should_ be safe and the correct fix (I've seen the same bug,<br>
> > btw), but I want somebody to double-check we are using Perl's UTF-8 for<br>
> > djabberd...<br>
> ><br>
> > Can somebody look at Devel::Peek on a scalar (say a username) when a<br>
> > non-ASCII username comes in, and see if the SvUTF8 flag is on?<br>
><br>
> Since it seems no one did it, I decided to take a closer look at this<br>
> request, and it seems the UTF8 flags is already set with or without my<br>
> patch :<br>
><br>
><br>
> without it :<br>
><br>
> SV = RV(0x8c64024) at 0x8c64018<br>
> REFCNT = 1<br>
> FLAGS = (PADMY,ROK)<br>
> RV = 0x8e12820<br>
> SV = PVAV(0x8e61cb8) at 0x8e12820<br>
> REFCNT = 6<br>
> FLAGS = (OBJECT,OVERLOAD)<br>
> STASH = 0x86d7d28 "DJabberd::JID"<br>
> ARRAY = 0x8eecd18<br>
> FILL = 5<br>
> MAX = 11<br>
> ARYLEN = 0x0<br>
> FLAGS = (REAL)<br>
> Elt No. 0<br>
> SV = PVMG(0x8da44dc) at 0x8e29b40<br>
> REFCNT = 1<br>
> FLAGS = (POK,pPOK,UTF8)<br>
> IV = 0<br>
> NV = 0<br>
> PV = 0x8d9b530 "phoebe"\0 [UTF8 "phoebe"]<br>
> CUR = 6<br>
> LEN = 8<br>
> Elt No. 1<br>
> SV = PVMG(0x8da4300) at 0x8f04940<br>
> REFCNT = 1<br>
> FLAGS = (POK,pPOK,UTF8)<br>
> IV = 0<br>
> NV = 0<br>
> PV = 0x8dfb378 "<a href="http://example.org" target="_blank">example.org</a>"\0 [UTF8 "<a href="http://example.org" target="_blank">example.org</a>"]<br>
> CUR = 11<br>
> LEN = 12<br>
> Elt No. 2<br>
> SV = PVMG(0x8da4290) at 0x8e29770<br>
> REFCNT = 1<br>
> FLAGS = (POK,pPOK,UTF8)<br>
> IV = 0<br>
> NV = 0<br>
> PV = 0x8da1410 "Sisay"\0 [UTF8 "Sisay"]<br>
> CUR = 5<br>
> LEN = 8<br>
> Elt No. 3<br>
> SV = PV(0x8db6030) at 0x8e38a80<br>
> REFCNT = 1<br>
> FLAGS = (POK,pPOK,UTF8)<br>
> PV = 0x8eecd50 "<a href="http://phoebe@example.org/Sisay" target="_blank">phoebe@example.org/Sisay</a>"\0 [UTF8<br>
> "<a href="http://phoebe@example.org/Sisay" target="_blank">phoebe@example.org/Sisay</a>"]<br>
> CUR = 24<br>
> LEN = 28<br>
><br>
><br>
> and with the patch<br>
><br>
> SV = RV(0x8c642cc) at 0x8c642c0<br>
> REFCNT = 1<br>
> FLAGS = (PADMY,ROK)<br>
> RV = 0x8f83560<br>
> SV = PVAV(0x8ef2df8) at 0x8f83560<br>
> REFCNT = 6<br>
> FLAGS = (OBJECT,OVERLOAD)<br>
> STASH = 0x86d7d28 "DJabberd::JID"<br>
> ARRAY = 0x8ef5eb0<br>
> FILL = 5<br>
> MAX = 11<br>
> ARYLEN = 0x0<br>
> FLAGS = (REAL)<br>
> Elt No. 0<br>
> SV = PVMG(0x8e37b08) at 0x8e75188<br>
> REFCNT = 1<br>
> FLAGS = (POK,pPOK,UTF8)<br>
> IV = 0<br>
> NV = 0<br>
> PV = 0x8d92f88 "phoebe"\0 [UTF8 "phoebe"]<br>
> CUR = 6<br>
> LEN = 8<br>
><br>
> Elt No. 1<br>
> SV = PVMG(0x8eb7cfc) at 0x8f10228<br>
> REFCNT = 1<br>
> FLAGS = (POK,pPOK,UTF8)<br>
> IV = 0<br>
> NV = 0<br>
> PV = 0x8ea5568 "<a href="http://example.org" target="_blank">example.org</a>"\0 [UTF8 "<a href="http://ephaone.org" target="_blank">ephaone.org</a>"]<br>
> CUR = 11<br>
> LEN = 12<br>
> Elt No. 2<br>
> SV = PVMG(0x8e37aec) at 0x8eed410<br>
> REFCNT = 1<br>
> FLAGS = (POK,pPOK,UTF8)<br>
> IV = 0<br>
> NV = 0<br>
> PV = 0x8e58dd8 "Sisay"\0 [UTF8 "Sisay"]<br>
> CUR = 5<br>
> LEN = 8<br>
> Elt No. 3<br>
> SV = PV(0x8de9dc0) at 0x8f02360<br>
> REFCNT = 1<br>
> FLAGS = (POK,pPOK,UTF8)<br>
> PV = 0x8f08a78 "<a href="http://phoebe@example.org/Sisay" target="_blank">phoebe@example.org/Sisay</a>"\0 [UTF8<br>
> "<a href="http://phoebe@ephaone.org/Sisay" target="_blank">phoebe@ephaone.org/Sisay</a>"]<br>
> CUR = 24<br>
> LEN = 28<br>
><br>
><br>
><br>
> So i guess that, if I add that i have been running the server since one<br>
> year without problem, that the patch is sae enough to be pushed<br>
> ( the one i posted on<br>
> <a href="http://lists.danga.com/pipermail/djabberd/2007-September/000401.html" target="_blank">http://lists.danga.com/pipermail/djabberd/2007-September/000401.html</a> )<br>
<br>
</div></div></blockquote></div><br>