diff options
Diffstat (limited to 'data/to_ascii.rb')
-rwxr-xr-x | data/to_ascii.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/data/to_ascii.rb b/data/to_ascii.rb new file mode 100755 index 0000000..6c1d23e --- /dev/null +++ b/data/to_ascii.rb @@ -0,0 +1,13 @@ +#!/usr/bin/env ruby + + +while line = STDIN.gets + encoding_options = { + :invalid => :replace, + :undef => :replace, + :replace => '?', + :universal_newline => true + } + puts line.encode 'ASCII', encoding_options +end + |