in reply to Re^2: system function not handling string properly
in thread system function not handling string properly

Try running a hexdump on the string. It seems it is UTF-16 encoded, there is a zero byte after each character. echo probably takes the null char as the end of string as in C.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^4: system function not handling string properly
by McA (Priest) on Sep 06, 2013 at 21:45 UTC

    In this case I would be really interested in

    print Dumper($link);

    ;)

      Normal Data::Dumper returns
      $VAR1 = 'www.youtube.com/watch?v=mark';

      but after setting

      $Data::Dumper::Useqq = 1;

      I get

      $VAR1 = "w\0w\0w\0.\0y\0o\0u\0t\0u\0b\0e\0.\0c\0o\0m\0/\0w\0a\0t\0c\0h +\0?\0v\0=\0m\0a\0r\0k\0";

      To get the correct output, I have to

      use Encode; $link = decode('utf-16-le', $link);
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

        Thank you. That is really interesting. Good finding!

        I'm really curious why Data::Dumper doesn't show the 0-bytes?

        Best regards
        McA