fixed encoding
fixed encoding
Credits and notes from #806