JCF: avoid convert to WideString to string and count WideChars instead of chars, fix problem on formatting strings with several non-ascii chars, issue 23715

git-svn-id: http://svn.freepascal.org/svn/lazarus/trunk@46756 4005530d-fff6-0310-9dd1-cebe43e6787f