That seems like a bad patch. You're modifying the caller's buffer! You really just want to modify the buffer that you write out to the socket.<div><br></div><div><div><div><div class="gmail_quote">On Mon, May 11, 2009 at 11:15 PM, Vladimir Lettiev <span dir="ltr"><<a href="mailto:thecrux@gmail.com">thecrux@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Yeah, this patch fixed the problem! Thank you, Eugene.<br>
<br>
(CC: DJabberd List)<br>
<br>
2009/5/11 Eugene Mamaev [emamaev at gmail dot com]:<br>
> Hello Vladimir,<br>
><br>
> Thursday, May 7, 2009, 11:12:23 AM, you wrote:<br>
><br>
>> 2009/5/7 Eugene Mamaev [emamaev at gmail dot com]:<br>
>>> I was trying to subscribe to their list several times but it seems<br>
>>> does not work. I did not get list digest on my email. I found your<br>
>>> note in djd list from google. I have a guess that the problem persists<br>
>>> if roster contains non ASCII chars. How to write to their list?<br>
><br>
>> Did you try to send mail to <a href="mailto:djabberd@lists.danga.com">djabberd@lists.danga.com</a> ?<br>
><br>
>> There was some problem, but it fixed now:<br>
>> <a href="http://lists.danga.com/pipermail/djabberd/2009-March/000709.html" target="_blank">http://lists.danga.com/pipermail/djabberd/2009-March/000709.html</a><br>
><br>
> Message is awaiting of moderator approval from may 7. Below is my fix,<br>
> please check if this helps to you.<br>
><br>
> Index: StartTLS.pm<br>
> ===================================================================<br>
> --- StartTLS.pm<br>
> +++ StartTLS.pm<br>
> @@ -2,6 +2,7 @@<br>
> use strict;<br>
> use base qw(DJabberd::Stanza);<br>
> use Net::SSLeay;<br>
> +use Encode qw(is_utf8 encode_utf8);<br>
><br>
> Net::SSLeay::load_error_strings();<br>
> Net::SSLeay::SSLeay_add_ssl_algorithms();<br>
> @@ -84,6 +85,10 @@<br>
> # NO LONGER RELEVANT?<br>
> # $to_write = 4096 if $to_write > 4096;<br>
><br>
> + if (is_utf8($$bref) && length($$bref) != $to_write) {<br>
> + $$bref = encode_utf8($$bref);<br>
> + }<br>
> +<br>
> my $str = substr($$bref, $offset, $to_write);<br>
> my $written = Net::SSLeay::write($ssl, $str);<br>
><br>
><br>
><br>
> --<br>
> Best regards,<br>
> Eugene mailto:<a href="mailto:emamaev">emamaev</a> at gmail dot com<br>
><br>
><br>
<font color="#888888"><br>
<br>
--<br>
Vladimir Lettiev aka crux <<a href="mailto:theCrux@gmail.com">theCrux@gmail.com</a>><br>
</font></blockquote></div><br></div></div></div>