AUI-1753 Improve Character Count checkLength() and its tests