josh803316 has asked for the wisdom of the Perl Monks concerning the following question:

I'm connecting to a remote IOS device and issue-ing remote commands on the device. Sometimes I'm seeing the following strange characters in my command returns: \r\u0000\r\n It is causing problems with my string and regex handling so I was wondering if there is a recommended way of handling this. Should I just convert the string return before copying and saving it? Is there a good module or standard approach for handling these unicode characters. Thank you for any advice in advance.
  • Comment on Unicode character handling with Net::Telnet::Cisco

Replies are listed 'Best First'.
Re: Unicode character handling with Net::Telnet::Cisco
by ikegami (Patriarch) on Jul 22, 2010 at 18:11 UTC
    \\ => "\\" \r => "\r" \n => "\n" \u0000 => chr(hex("0000"))
      I'm sorry to be obtuse but how do I use that..........as a configuration option or do you mean as a way to convert the returned text?
        I provided the code that produces the appropriate character for each sequence. Execute the corresponding code each time you come across one of the sequences, replacing the sequence with the result of the code.