vpim icon indicating copy to clipboard operation
vpim copied to clipboard

fix 'invalid multibyte escape' error

Open martin-straub opened this issue 11 years ago • 0 comments

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 with value.force_encoding "BINARY" and value.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…

martin-straub avatar Dec 18 '14 13:12 martin-straub