Sha256: 40700af7588f6ec221c1cf23f3e8888115789615ee13e16b0b0cec684b236981
Contents?: true
Size: 297 Bytes
Versions: 10
Compression:
Stored size: 297 Bytes
Contents
module Temple module Filters # Remove BOM from input string # # @api public class RemoveBOM < Parser def call(s) return s if s.encoding.name !~ /^UTF-(8|16|32)(BE|LE)?/ s.gsub(Regexp.new("\\A\uFEFF".encode(s.encoding.name)), '') end end end end
Version data entries
10 entries across 10 versions & 3 rubygems