Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Get String Length for ANSI, utf-8, and Unicode
How to get the string length in bytes, and in number of characters. CkString str; str.append(""); printf("ANSI # Bytes: %d\n",str.getSizeAnsi()); printf("utf-8 # Bytes: %d\n",str.getSizeUtf8()); printf("Unicode # Bytes: %d\n",str.getSizeUnicode()); printf("Number of chars: %d\n",str.getNumChars()); // Prints: // ANSI # Bytes: 4 // utf-8 # Bytes: 8 // Unicode # Bytes: 8 // Number of chars: 4
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.