Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 13th, 2012  |  syntax: None  |  size: 0.21 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $KCODE = 'u'
  2.  
  3. File.open(ARGV.first) do |f|
  4.   f.lines.each_with_index do |l, li|
  5.     l.bytes.each_with_index do |b, bi|
  6.       puts "Line #{ li }, pos #{ bi } has #{ b } (#{ b.chr })" if b > 127
  7.     end
  8.   end
  9. end