fix window bug
fix encoding bug