summaryrefslogtreecommitdiff
path: root/to-ascii
blob: 10fd1c29a1ccbeaddee2a04fd5d53564557badc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/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