I am cleaning several websites, and in the end I hit a UTF-8 error that looks like this:
/usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.2.0/lib/dm-core/support/ext/blank.rb:19:in `=~': invalid byte sequence in UTF-8 (ArgumentError)
Now I donβt care about websites being 100% accurate. Is there a way that I can take the page I get and cross out any encodings of the problems and then pass it inside my program?
I am using ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
if that matters.
Update:
def self.blank?(value) return value.blank? if value.respond_to?(:blank?) case value when ::NilClass, ::FalseClass true when ::TrueClass, ::Numeric false when ::Array, ::Hash value.empty? when ::String value !~ /\S/
When I try to save the following line:
What Happens in The Garage Tin Sign2. Γ―ΒΏΒ½ Γ―ΒΏΒ½ Newsletter Our monthly newsletter,
He gives an error. He is on the page: http://www.stationbay.com/ . But the strange thing is that when I view it in my web browser, it does not show funny characters in the source.
What should I do next?
source share