Sha256: 8e10a6fa93697978a7ebd3b34a4165804a95603573cdf8a1927dbf2d98df5bd6
Contents?: true
Size: 446 Bytes
Versions: 21
Compression:
Stored size: 446 Bytes
Contents
# -*- encoding : utf-8 -*- class Phrase::Tool::EncodingDetector def self.file_seems_to_be_utf16?(file) file_seems_to_be_utf16_be?(file) or file_seems_to_be_utf16_le?(file) end def self.file_seems_to_be_utf16_be?(file) input = IO.read(file, 2) input and input.bytes.to_a == [0xFE, 0xFF] end def self.file_seems_to_be_utf16_le?(file) input = IO.read(file, 2) input and input.bytes.to_a == [0xFF, 0xFE] end end
Version data entries
21 entries across 21 versions & 1 rubygems