in reply to Re: Encoding problem on SOAP web server
in thread Encoding problem on SOAP web server

I think you are wrong.

utf8::encode($string) modifies in-place passed var and return nothing.

http://perldoc.perl.org/utf8.html :

utf8::encode($string) Converts in-place the character sequence to the corresponding octet sequence in UTF-X. That is, every (possibly wide) character gets replaced with a sequence of one or more characters that represent the individual UTF-X bytes of the character. The UTF8 flag is turned off. Returns nothing.

  • Comment on Re^2: Encoding problem on SOAP web server

Replies are listed 'Best First'.
Re^3: Encoding problem on SOAP web server
by hotchiwawa (Scribe) on Jan 12, 2016 at 12:39 UTC
    Yep right, strange (if we compare with other convertion functions) but if we go deeper, the input parameter should be a reference and here $response is a value ("ייי"), or maybe I don't understand something! Can you explain that?!

    Edit (explanation)
    Thanks to choroba.
    Found in perlsub: http://perldoc.perl.org/perlsub.html

    if you called a function with two arguments, those would be stored in $_[0] and $_1 . The array @_ is a local array, but its elements are aliases for the actual scalar parameters. In particular, if an element $_[0] is updated, the corresponding argument is updated (or an error occurs if it is not updatable).
      sub no_reference { $_[0] =~ s/o/O/g; } $string = 'Bozo is a clown'; no_reference($string); print $string, "\n";
      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      Why do you say "the input parameter should be a reference" ? This is not in the documentation.
        Sorry, since choroba had answered your question I had understand it...

      Why do you say "the input parameter should be a reference" ?

      This is not in the documentation.

        double post...sorry