Added encoding to handle Unicode characters.

TODO:

- [x] Add `charset` to HTML
- [ ] Refactor decode/encode read/write into two common functions