vpim
vpim copied to clipboard
fix 'invalid multibyte escape' error
Working with Ruby 2.1.5
# -*- encoding : binary -*-fixed my 'invalid multibyte escape' error, like it did in Fix invalid multi-byte escape errors on ruby 1.9.- But then I ran into another
Encoding::CompatibilityError: incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string)fixed withvalue.force_encoding "BINARY"andvalue.force_encoding("utf-8"). - I admit I just pattern matched and don't understand what's going on in detail.
- I guess the following method has to be treated equally (but my code doesn't touch it):
def Vpim.encode_paramtext(value)
case value
when %r{\A#{Bnf::SAFECHAR}*\z}
value
else
raise Vpim::Unencodeable, "paramtext #{value.inspect}"
end
end
- And perhaps other Vpim.decode_X methods containing
%r{…}, too. - I'm still trying to get the vpim tests running…