List Info

Thread: VCard and roster in UTF.




VCard and roster in UTF.
country flaguser name
Russian Federation
2008-03-14 06:31:42
Hello,

I have a problem with data in VCard which stored in
Russian,
I see that data saved correctly in my db, but when I retrive
my vcard 
from server I see that everything was in russian is broken.
I've investigate this issue a little and found that data
changed on call 
function write of module Danga::Socket. Also I've found in
front of this 
module pragma use bytes;
When I comment out this line, I've got correct vcatds but
start got the 
following error when sending messages in russian:
6354 ERROR DJabberd.Connection.ClientIn             1
disconnected 
DJabberd::Connection::ClientIn=ARRAY(0x8e6f9fc) because:
Wide character 
in syswrite at Danga/Socket.pm line 1034.

How I can fix this issue?



Re: VCard and roster in UTF.
country flaguser name
Russian Federation
2008-03-21 02:46:05
I've fixed this issue by adding 'use bytes' pragma into 
DJabberd::Connection class.
This was not issue in SQLite, because in
DJabberd::Connection->write() 
function was one data but right on enter into function 
Danga::Socket->write() function data was different.


Brad Fitzpatrick wrote:
> You have a minimal test that shows corruption going
through Danga::Socket?
>
> I thought this was fixed awhile ago, and I thought the
issue was in 
> SQLite.
>
> Do you know how Unicode works in Perl?  (with the
SvUTF8 flag?)
>
>
> On Fri, Mar 14, 2008 at 4:31 AM, Aleksey Luzin
<subscrp34.net 
> <mailto:subscrp34.net>> wrote:
>
>     Hello,
>
>     I have a problem with data in VCard which stored in
Russian,
>     I see that data saved correctly in my db, but when
I retrive my vcard
>     from server I see that everything was in russian is
broken.
>     I've investigate this issue a little and found that
data changed
>     on call
>     function write of module Danga::Socket. Also I've
found in front
>     of this
>     module pragma use bytes;
>     When I comment out this line, I've got correct
vcatds but start
>     got the
>     following error when sending messages in russian:
>     6354 ERROR DJabberd.Connection.ClientIn            
1 disconnected
>     DJabberd::Connection::ClientIn=ARRAY(0x8e6f9fc)
because: Wide
>     character
>     in syswrite at Danga/Socket.pm line 1034.
>
>     How I can fix this issue?
>
>
>
> !DSPAM:47e31640160398165083049! 


Re: VCard and roster in UTF.
user name
2008-03-21 10:07:10
That sounds like the right fix.

Nothing in DJabberd should ever deal with Perl-level UTF8.... just in bytes.&nbsp; When we get things from the XML layer (which is Perl-UTF8), we immediate turn off the flag and treat it as bytes.

Checked into svn r774.

On Fri, Mar 21, 2008 at 12:46 AM, Aleksey Luzin < subscrp34.net">subscrp34.net&gt; wrote:
I've fixed this issue by adding 'use bytes' pragma into
DJabberd::Connection class.
This was not issue in SQLite, because in DJabberd::Connection->write()
function was one data but right on enter into function
Danga::Socket->write() function data was different.


Brad Fitzpatrick wrote:
&gt; You have a minimal test that shows corruption going through Danga::Socket?
>
> I thought this was fixed awhile ago, and I thought the issue was in
> SQLite.
>
> Do you know how Unicode works in Perl?  (with the SvUTF8 flag?)
&gt;
>
> On Fri, Mar 14, 2008 at 4:31 AM, Aleksey Luzin < subscrp34.net">subscrp34.net
> <mailto: subscrp34.net">subscrp34.net&gt;> wrote:
&gt;
>     Hello,
&gt;
>     I have a problem with data in VCard which stored in Russian,
>     I see that data saved correctly in my db, but when I retrive my vcard
&gt;     from server I see that everything was in russian is broken.
>     I've investigate this issue a little and found that data changed
>     on call
>;     function write of module Danga::Socket. Also I've found in front
&gt;     of this
>;     module pragma use bytes;
&gt;     When I comment out this line, I've got correct vcatds but start
&gt;     got the
>     following error when sending messages in russian:
>     6354 ERROR DJabberd.Connection.ClientIn             1 disconnected
>     DJabberd::Connection::ClientIn=ARRAY(0x8e6f9fc) because: Wide
>;     character
>     in syswrite at Danga/Socket.pm line 1034.
&gt;
>     How I can fix this issue?
&gt;
>
>
&gt; !DSPAM:47e31640160398165083049!


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )