rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
user71 has joined #ruby
weaksauc_ has joined #ruby
weaksauce has quit [Ping timeout: 245 seconds]
dhruvasagar has quit [Ping timeout: 272 seconds]
dhruvasagar has joined #ruby
hwpplayer1 has quit [Ping timeout: 252 seconds]
ftajhii has quit [Ping timeout: 248 seconds]
mange has quit [Quit: Zzz...]
desnudopenguino has quit [Ping timeout: 255 seconds]
tuxcrafter59 has quit [Quit: Client closed]
sarna has quit [Remote host closed the connection]
sarna has joined #ruby
Linux_Kerio has joined #ruby
dhruvasa` has joined #ruby
greybeard has joined #ruby
kiwi_36 has joined #ruby
kiwi_36 has quit [Client Quit]
kiwi_36 has joined #ruby
dhruvasa` has quit [Ping timeout: 248 seconds]
dhruvasagar has quit [Ping timeout: 252 seconds]
hwpplayer1 has joined #ruby
dhruvasa` has joined #ruby
dhruvasagar has joined #ruby
Linux_Kerio has quit [Ping timeout: 248 seconds]
Linux_Kerio has joined #ruby
Linux_Kerio has quit [Ping timeout: 265 seconds]
hwpplayer1 has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.4)]
grenierm has quit [Ping timeout: 256 seconds]
dhruvasa` has quit [Ping timeout: 272 seconds]
dhruvasagar has quit [Ping timeout: 272 seconds]
DuckZ has joined #ruby
<DuckZ>
hello, I'm doing some regex matching through a log file which sometimes contains invalid characters, which makes the matching function throw. Is there a way to sanitise the input and remove anything that'd make the regex error out?
dhruvasagar has joined #ruby
dhruvasa` has joined #ruby
dhruvasa` has quit [Ping timeout: 265 seconds]
dhruvasagar has quit [Ping timeout: 265 seconds]
dhruvasa` has joined #ruby
dhruvasagar has joined #ruby
dhruvasa` has quit [Ping timeout: 252 seconds]
dhruvasagar has quit [Ping timeout: 252 seconds]
dhruvasa` has joined #ruby
dhruvasagar has joined #ruby
dhruvasagar has quit [Remote host closed the connection]
dhruvasa` has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
dhruvasa` has joined #ruby
thefuture_ has joined #ruby
kiwi_36 has quit [Ping timeout: 252 seconds]
lunarkitty has quit [Remote host closed the connection]
dhruvasagar has quit [Remote host closed the connection]
dhruvasa` has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
dhruvasa` has joined #ruby
dhruvasagar has quit [Ping timeout: 248 seconds]
dhruvasa` has quit [Ping timeout: 248 seconds]
dhruvasagar has joined #ruby
dhruvasa` has joined #ruby
oneeyedalien has joined #ruby
konsolebox has quit [Ping timeout: 248 seconds]
oneeyedalien has quit [Quit: Leaving]
desnudopenguino has joined #ruby
hwpplayer1 has joined #ruby
<adam12>
DuckZ: Example of what you're seeing?
<DuckZ>
> ip_from_logs.rb:250:in `match': invalid byte sequence in UTF-8 (ArgumentError)
<adam12>
DuckZ: Is the file utf-8?
<adam12>
DuckZ: Could maybe try formatting the result string with `string.encode('UTF-8', replace: nil)` or something.
dhruvasa` has quit [Remote host closed the connection]
dhruvasagar has quit [Remote host closed the connection]
hwpplayer1 has quit [Remote host closed the connection]
thefuture_ has quit [Remote host closed the connection]
<DuckZ>
file is a mess, it's the output of my serial cable connection to another device, it ends up containing all sort of binary rubbish, in that specific case I think it's a transmission error, probably I unplugged the cable or something happened
<DuckZ>
so it's fine to ignore anything that looks non-ascii and non-utf, or it may be all ascii I'm not sure
<DuckZ>
this is the line where it throws: "{ 12.018} bluetoH{ 12.030} bluetoothd[835]" and in the hex editor I see "af a8 48 f8" between "o" and "{"
Milos_ is now known as Milos
<DuckZ>
trying `raw_line = raw_line.encode('UTF-8', replace: nil)` btw it's not making any difference unfortunately