Item12348: fixed substr() on byte strings

... need to convert them to unicode before :(