I have a string I’m converting from "rn"
to "n"
line ends using:
input.gsub(/rn?/, "n")
When I run it on my Windows host, it works fine. When I run on my Linux host, in a docker container, I get this error:
in `gsub': invalid byte sequence in US-ASCII (ArgumentError)
I am running Ruby 2.2.
Advertisement
Answer
I fixed it by doing this Invalid byte sequence in UTF-8 (ArgumentError)