Fix wrong length determination for strings with two byte encoded symbols (e.g. cyrillic)