encoding support with documentation

Hi!

I rebased and documented the pull request #85.
Please check the patch and documentation,
and if there's something wrong or i can do further, please let me know.

Thanks!

Regards.