title: Gsub raises "invalid byte sequence in UTF-8"
body: <p>I have the next method call:</p>
  
  <pre><code>Formatting.git_log_to_html(`git log --no-merges master --pretty=full #{interval}`)
  </code></pre>
  
  <p>The value of <code>interval</code> is something like <code>release-20130325-01..release-20130327-04</code>.</p>
  
  <p>The <code>git_log_to_html</code> ruby method is the next (I am only pasting the line what raises the error):</p>
  
  <pre><code>module Formatting
    def self.git_log_to_html(git_log)
      ...
      git_log.gsub(/^commit /, "COMMIT_STARTcommit").split("COMMIT_STARTcommit").each do |commit|
      ...
    end
  end
  </code></pre>
  
  <p>This used to work, but actually I checked that gsub is raising an "invalid byte sequence in UTF-8" error.</p>
  
  <p>Could you help to understand why and how can I fix it? :/</p>
  
  <p>Here is the output of <code>git_log</code>:</p>
  
  <p><a href="https://dl.dropbox.com/u/42306424/output.txt" rel="nofollow">https://dl.dropbox.com/u/42306424/output.txt</a></p>