Skip to content

Instantly share code, notes, and snippets.

@jhoblitt
Created September 27, 2013 23:10
Show Gist options
  • Save jhoblitt/6736485 to your computer and use it in GitHub Desktop.
Save jhoblitt/6736485 to your computer and use it in GitHub Desktop.
Demonstration of Ruby String encoding doing something unexpected with ASCII text.
$ stat --printf="%s\n" README.rdoc
10576
$ perl -le 'print length do { local(@ARGV, $/)="README.rdoc"; <> };'
10576
$ ruby -e 'p File.read("README.rdoc").length'
10555
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment