Dave Burt
4/19/2006 10:15:00 PM
baumanj@gmail.com wrote:
> In that case:
>
> invalid = false
> url.each_byte {|b| invalid = true if b > 127 }
Or:
require 'enumerator'
class String
def seven_bit_clean?
self.each_byte.all? {|c| c <= 127 }
end
end
Cheers,
Dave