invalid multibyte escape: /[\x80-\xFF]/ (SyntaxError)
tuhaolam opened this issue · comments
-> % whatweb https://github.com/urbanadventurer/WhatWeb
/usr/bin/whatweb: /usr/lib/ruby/vendor_ruby/rchardet/universaldetector.rb:39: invalid multibyte escape: /[\x80-\xFF]/ (SyntaxError)
[/mnt/d/tuhao/python/clawer/12306]
-> % cat /etc/issue
Ubuntu 16.04.3 LTS \n \l
[/mnt/d/tuhao/python/clawer/12306]
-> % uname -a
Linux LAPTOP-23FMDQ6R 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux
This fix from https://forum.backbox.org/software-support/whatweb-problem/ worked for me, it's just updating the file to what's found here: https://github.com/jmhodges/rchardet/blob/master/lib/rchardet/universaldetector.rb
Apparently gem update
should fix it but it didn't for me. I'm not a ruby person but setting the version of the rchardet gem to a more recent version should fix the issue for good.
sudo nano -c /usr/lib/ruby/vendor_ruby/rchardet/universaldetector.rb
Add on first line:
# encoding: US-ASCII
This is interesting.
Try executing
gem update rchardet
This patch to the rchardet gem was made in 2014.
jmhodges/rchardet@974f058#diff-22187cab67ebd193baca677a2e8e54c3