“\\xE7“ to UTF-8 in conversion from ASCII-8BIT to UTF-8 to UTF-16LE

Vagrant/embedded/gems/2.2.19/gems/childprocess-4.1.0/lib/childprocess/windows/process_builder.rb:44:in `encode!’: “\xE7” to UTF-8 in conversion from ASCII-8BIT to UTF-8 to UTF-16LE (Encoding::UndefinedConversionError)

找到报错信息的process_builder.rb 44行,编码位置换成一下:

  def to_wide_string(str)
        newstr = str + "\0".encode(str.encoding)
#         newstr.encode!('UTF-16LE')
        newstr.encode!('UTF-16LE', invalid: :replace, undef: :replace, replace: '?')
      end

版权声明:本文为wwg1234wwg1234原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。