-
-
Save civitaspo/262a2f0326fb07ab0e185037af4c03b8 to your computer and use it in GitHub Desktop.
This file contains 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
$ ruby test.rb | |
UTF-8 | |
test_b.rb:8:in `include?': incompatible character encodings: UTF-8 and Windows-31J (Encoding::CompatibilityError) | |
from test_b.rb:8:in `block in <main>' | |
from test_b.rb:5:in `open' | |
from test_b.rb:5:in `<main>' |
This file contains 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
# encoding: cp932 | |
# frozen_string_literal: true | |
# | |
File.open 'testdata' do |f| | |
while line = f.gets do | |
puts line.encoding | |
if line.include?("うう") | |
puts line | |
end | |
end | |
end |
This file contains 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
あ | |
い | |
う |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment