more bulletproofing for unicode support