You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd returns strings with different encodings in some cases #34
I am using the Net::Telnet gem to connect to remove servers, most of the times, the returned string by the cmd method has UTF-8 encoding, but the other day, one of the outputs from the server returned the character "ñ" and when the character is present in the output the encoding from the string is BINARY, I could not figure out where this change in the encoding is happening and why
Example:
client=Net::Telnet.new('Host'=>"192.168.1.2",'Port'=>23,'Prompt'=>//,'Waittime'=>0.5,'Timeout'=>30)result_1=client.cmd("test 1")# command does not return ñresult_1.encoding->#<Encoding:UTF-8>result_2=client.cmd("test 2")# command does return ñresult_2.encoding -> #<Encoding:BINARY>
Activity