In Files

Parent

Methods

File

Public Class Methods

read_utf(path) click to toggle source

Like File::read, but strips out a BOM marker if it exists.

     # File lib/hoe.rb, line 840
840:   def self.read_utf path
841:     r19 = "<3".respond_to? :encoding
842:     opt = r19 ? "r:bom|utf-8" : "rb"
843: 
844:     open path, opt do |f|
845:       if r19 then
846:         f.read
847:       else
848:         f.read.sub /\A\xEF\xBB\xBF/, ''
849:       end
850:     end
851:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.