fix UnicodeEncodeError exception when reading headers. fixes #106, #108, and #114.