summaryrefslogtreecommitdiff
path: root/to_ascii
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-08-16 21:27:58 +0100
committerPatrick Simianer <p@simianer.de>2014-08-16 21:27:58 +0100
commita3fee2abd19ed0aedebc0f3949fb969f2ce7836e (patch)
tree47b36fa96b5f2c85f49c92e3bd8f53010cf059a4 /to_ascii
parentbad18ebfd358e4352643831040e45ad5435eff48 (diff)
memusg, to_ascii
Diffstat (limited to 'to_ascii')
-rwxr-xr-xto_ascii13
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
+