Created
October 18, 2011 04:58
-
-
Save holysugar/1294637 to your computer and use it in GitHub Desktop.
Ripper causes Encoding::CompatibilityError
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
text = <<EOS | |
# coding: utf-8 | |
'あ | |
あ' | |
EOS | |
require 'ripper' | |
Ripper.new(text).parse | |
# $ ruby -v ripper_encodingerror.rb | |
# ruby 1.9.3dev (2011-09-23 revision 33323) [x86_64-darwin11.1.0] | |
# ripper_encodingerror.rb:10:in `parse': incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError) | |
# from ripper_encodingerror.rb:10:in `<main>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ちなみに text の magic comment のあるなしで挙動は変わりません