fix encoding stuff and finally figured out that piece of weird code

ruby is somehow unable to detect the encoding of a file. reading an utf-8 file returns a string encoded as US-ASCII. this method forced an encoding (just marking it as utf-8 without changing it) and then checked whether it's valid (a file which was utf-8 encoded will then be valid, other's won't). if it's invalid then (as a fallback) String's encode method is called.

the bug here was that force_encoding changes its receiver and then encode will be called on that which confused ruby even more…