I have the following string that I would like to split on the \xA7 character.
\xFF$New Server\xA77\xA750
The problem being is that I can’t figure out how to tell Ruby to split it correctly on the \xA7 marker.
This is the error I get:
>> "\xFF$New Server\xA77\xA750".split("\xA7")
ArgumentError: invalid byte sequence in UTF-8
from (irb):26:in `split'
from (irb):26
from /Users/wedtm/.rbenv/versions/1.9.2-p290/bin/irb:12:in `<main>'
When forcing the encoding to
BINARYyou can work around that issue, though not sure if it’s the correct solution or breaks other things…