getCharCount for ruby.js