Fixed JSON encoding error

When git's log contain UTF8 code (e.g. Chinese text), `to_json` conver it to wrong string with `"���"`

![qq20130826-1](https://f.cloud.github.com/assets/1243254/1023611/320d06e2-0df9-11e3-8054-9a12e7314bce.png)

With this fix, encoding will work correctly.