DLVARScriptTesting.rb:175:in `sub!': incompatible encoding regexp match (UTF-8 regexp with IBM437 string) (Encoding::CompatibilityError)
from DLVARScriptTesting.rb:175:in `block in parse_file'
from DLVARScriptTesting.rb:171:in `each'
from DLVARScriptTesting.rb:171:in `each_with_index'
from DLVARScriptTesting.rb:171:in `parse_file'
from DLVARScriptTesting.rb:371:in `<main>'
That's the full error.
Here are lines 171 & 175
File.readlines(testfile).each_with_index do |line, line_num|
line.sub!(/^\xEF\xBB\xBF/, '') if line_num == 0
I've tried setting the encoding to utf-8 but that isn't working Basically what the code is trying to do is remove xEF xBB xBF before a string if it's there.