redo char counter logic (bug 1036422)
Merge pull request #14 from spasovski/counterlogic

redo char counter logic (bug 1036422)