Hi, I had the same issue, the only way to have a more accurate count was to change some configurations on the editor.The plugin is returning a higher number because is counting newlines a other tabulations.
Add the code in red to CKeditor WB, this will remove tabulations and the count will start to match the number of characters.
I strongly advise you to remove the limit of number of characters on the associated input and add a server side validation to check if the number of characters is not higher that your attribute on the DataBase. This way you will avoid saving bad html or even getting db errors while saving.
ckConfig.on = {
saveSnapshot: $('#' + ssInputId)[0].ckEditorUpdate,
key: $('#' + ssInputId)[0].ckEditorUpdate,
afterCommandExec: $('#' + ssInputId)[0].ckEditorUpdate,
change: $('#' + ssInputId)[0].ckEditorUpdate,
instanceReady: function() {
// Output self-closing tags the HTML4 way, like <br>.
this.dataProcessor.writer.selfClosingEnd = '>';
this.dataProcessor.writer.lineBreakChars = '';
// Use line breaks for block elements, tables, and lists.
var dtd = CKEDITOR.dtd;
for ( var e in CKEDITOR.tools.extend( {}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent ) ) {
this.dataProcessor.writer.setRules( e, {
indent: false,
breakBeforeOpen: false,
breakAfterOpen: false,
breakBeforeClose: false,
breakAfterClose: false
});
}
}
};