Skip to content

Instantly share code, notes, and snippets.

@meatballhat
Last active December 29, 2015 13:39
Show Gist options
  • Select an option

  • Save meatballhat/7678198 to your computer and use it in GitHub Desktop.

Select an option

Save meatballhat/7678198 to your computer and use it in GitHub Desktop.
Ruby encoding comment mythbusters
# encoding: us-ascii
puts "#{RUBY_DESCRIPTION}: #{$0} -> #{__ENCODING__}"
# encoding: utf-8
puts "#{RUBY_DESCRIPTION}: #{$0} -> #{__ENCODING__}"
# vim:fileencoding=us-ascii
puts "#{RUBY_DESCRIPTION}: #{$0} -> #{__ENCODING__}"
# vim:fileencoding=utf-8
puts "#{RUBY_DESCRIPTION}: #{$0} -> #{__ENCODING__}"
#!/bin/bash
for f in *.rb ; do
ruby $f
done
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.4.0]: colon-style-us-ascii.rb -> US-ASCII
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.4.0]: colon-style-utf-8.rb -> UTF-8
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.4.0]: equal-style-us-ascii.rb -> US-ASCII
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.4.0]: equal-style-utf-8.rb -> UTF-8
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]: colon-style-us-ascii.rb -> US-ASCII
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]: colon-style-utf-8.rb -> UTF-8
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]: equal-style-us-ascii.rb -> US-ASCII
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]: equal-style-utf-8.rb -> UTF-8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment