Fix the encoding

Fix the encoding of puts to logfile