Last active
December 1, 2015 14:35
-
-
Save myokoym/1dd5c355b18d4be9dc8f 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 | |
#encoding = ARGV.shift | |
#args = ARGV.dup | |
#args.map! do |arg| | |
# arg.encode(encoding) | |
#end | |
#system(*ARGV) | |
encoding = ARGV.shift | |
while line = ARGF.gets | |
if encoding == "utf-8" | |
puts line.encode(encoding, invalid: :replace) | |
else | |
puts line.force_encoding("utf-8") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment