diff options
Diffstat (limited to 'to_ascii')
-rwxr-xr-x | to_ascii | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/to_ascii b/to_ascii new file mode 100755 index 0000000..6c1d23e --- /dev/null +++ b/to_ascii @@ -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 + |