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