class File

Public Class Methods

charset(file_path) click to toggle source

@param [ String ] file_path

@return [ String ] The charset of the file

# File lib/common/hacks.rb, line 77
def self.charset(file_path)
  %x{file --mime #{file_path}}[%r{charset=([^\n]+)\n}, 1]
end