This post moved to
https://squarism.com/posts/encoding-in-ruby-and-everywhere
.