Skip to content

Instantly share code, notes, and snippets.

@shyouhei
Created December 8, 2011 03:25
Show Gist options
  • Save shyouhei/1445972 to your computer and use it in GitHub Desktop.
Save shyouhei/1445972 to your computer and use it in GitHub Desktop.
Coverage kills encodings
zsh % ruby -ve '
require "fileutils"
require "coverage"
FileUtils.mkdir_p "ディレクトリ"
FileUtils.touch "ディレクトリ/ファイル.rb"
$LOAD_PATH << "ディレクトリ"
Coverage.start
require "ファイル"
[
$LOADED_FEATURES.last,
Coverage.result.keys.last
].each do |i|
p [i.encoding, i]
end'
ruby 2.0.0dev (2011-12-08 trunk 33977) [x86_64-linux]
[#<Encoding:UTF-8>, "/home/shyouhei/ディレクトリ/ファイル.rb"]
[#<Encoding:ASCII-8BIT>, "/home/shyouhei/\xE3\x83\x87\xE3\x82\xA3\xE3\x83\xAC\xE3\x82\xAF\xE3\x83\x88\xE3\x83\xAA/\xE3\x83\x95\xE3\x82\xA1\xE3\x82\xA4\xE3\x83\xAB.rb"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment