* fix buggy computing length of string containing non-ASCII characters