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