benhoskings/omglog — pull request #2 by darthdeus (2012-03-03 13:00:19+00:00)
Title: External encoding is now set to UTF-8 to support unicode characters

If there are special characters in the commit message, running `omglog` on the repository will fail with

/Users/darthdeus/.rvm/gems/ruby-1.9.2-p290@global/gems/omglog-0.0.2/bin/omglog:16:in `split': invalid byte sequence in US-ASCII (ArgumentError)
from /Users/darthdeus/.rvm/gems/ruby-1.9.2-p290@global/gems/omglog-0.0.2/bin/omglog:16:in `block in omglog'
from /Users/darthdeus/.rvm/gems/ruby-1.9.2-p290@global/gems/omglog-0.0.2/bin/omglog:15:in `tap'
from /Users/darthdeus/.rvm/gems/ruby-1.9.2-p290@global/gems/omglog-0.0.2/bin/omglog:15:in `omglog'
from /Users/darthdeus/.rvm/gems/ruby-1.9.2-p290@global/gems/omglog-0.0.2/bin/omglog:52:in `'
from /Users/darthdeus/.rvm/gems/ruby-1.9.2-p290/bin/omglog:19:in `load'
from /Users/darthdeus/.rvm/gems/ruby-1.9.2-p290/bin/omglog:19:in `

'

This can be easily fixed with `Encoding.default_external = Encoding::UTF_8`

Steps to reproduce

mkdir sandbox
cd sandbox
git init
echo foo > bar
git add .
git commit -m "initial čommit"
omglog # exception raised here because of the č character