fixed page encoding bug; better char matching