better counting of strings with unicode characters in them