summaryrefslogtreecommitdiff
path: root/data/to_ascii.rb
diff options
context:
space:
mode:
Diffstat (limited to 'data/to_ascii.rb')
-rwxr-xr-xdata/to_ascii.rb13
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
+