I meant why the `pos--`.  You don't need to step back to whitespace (and in your example you skip back to the 'g') - by doing so all you do is skip over the whitespace and then fail to hit "encoding" again.