The "SHIFT-JIS" encoding uses single bytes for characters in the ASCII range.
I can see that your text is ASCII, but this line of code:
stringLength = (nextOffset - currentOffset - 1) / 2;
is assuming that the characters are occupying two bytes.