BUG: encode to utf8, should probably try to get the preferred user encoding