https://code.google.com/p/stringencoding/