Sha256: d9e5e8020cef91a328ac1e8987c35fd8ca228d45356b50604fb12b583df589ba
Contents?: true
Size: 274 Bytes
Versions: 31
Compression:
Stored size: 274 Bytes
Contents
#! /usr/bin/env ruby # Replaces invalid utf-8 characters with �. # # Usage: # $ cat some_file | string_encoder while input = gets if input.to_s.valid_encoding? puts input else puts input.encode('UTF-8', 'binary', invalid: :replace, undef: :replace) end end
Version data entries
31 entries across 31 versions & 1 rubygems