cast writes to unicode before write