slightly better non-ascii handling