Don't mean to be pedantic, but this comment left me very confused, surely you mean carriage return to be ASCII 13? Also, g is the 7th character and BEL is 7.
Ugh. I've gone ahead and fixed it. I am not having a good night. I was actually sitting here typing all of that because my shoulder hurts so much I can't sleep, and apparently I am so tired I can't count.