Fix an issue with using ascii encoding internally

Also this describes some of the expected behaviour for differently
encoded strings.
change to splitting directly on string
add an encoding notice for this file, might fix the travis build issue (linux)
matching formatting to convention
attempt 2 at fixing travis
fix encoding regression caused by shadowing variables and some typos
handle compatibility errors and increase test coverage
Update yard docs to use expect syntax
Tweak documentaion to read better.
Merge pull request #223 from gautamkpai/update_docs

Update yard docs to use expect syntax
Merge pull request #220 from JonRowe/fix_internal_encoding_error

Encode diff literals according to the actual output encoding.
Changelog entry for #220.

[ci skip]