I'm having trouble with unicode versus octets

Fulko Hew fulko.hew at gmail.com
Mon Oct 15 20:16:59 CEST 2012


In my app, I receive strings, massage them, and use push_write() to enqueue
them.

Occasionally, my app receives a unicoded string...
so when the write happens, push_write() dies with the error:

   Wide character in subroutine entry at ...

because of the else clause in this snippet from push_write():

   if ($self->{tls}) {
      utf8::downgrade $self->{_tls_wbuf} .= $_[0];
      &_dotls ($self)    if $self->{fh};
   } else {
      utf8::downgrade $self->{wbuf}      .= $_[0];
      $self->_drain_wbuf if $self->{fh};
   }

I want/need? to be able to treat the AnyEvent handle/data-path as an octet
path
and not unicode (because any unicode-iness is between the originator
and the ultimate destination, and not my code, nor handle in between.)

What I haven't figured out yet is how to either:

a) coerce the character string into an octet string
   (for the rest of its life, ie. in subsequent modules)
   so the warning/dying goes away.
b) add something (???) so that it go through that code.

What is the correct process I should use?

TIA
Fulko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20121015/1ca6a483/attachment.html>


More information about the anyevent mailing list