Default encoding

This is an addition to @ssx's #162. Now the locale is guessed based on browser's headers. Defaults to en_US.UTF-8.