Understanding EncryptStringENC and DecryptStringENC in Python and C/C++

Chilkat provides API’s that are identical across a variety of different programming languages. One difficulty in doing this is in handling strings. Different programming languages pass strings in different ways. In some programming languages, such as Python or C/C++, a “string” is simply a sequence of bytes terminated by a null. (I’m referring to “multibyte” strings, not Unicode (utf-16) strings. […]

BASE64 Decode with Charset GB2312

Question: I have a Base64 decode error, as follows: CkString str; str.setString(“16q”); str.base64Decode(“gb2312”); const char *strResult = str.getString(); convert result is { cb f2 } But the correct result should be { d7 aa} What’s wrong? The platform is WinCE 6.0, use Chilkat_PPC_M5.lib Answer: The following code shows how to do it correctly: CkString str; str.setString(“16q”); // The following line […]

Encrypting Chinese Characters

Question: Why is it the return is blank when encrypting chinese characters? Here’s a snippet of my code: crypt.KeyLength := 256; crypt.SecretKey := Password; crypt.CryptAlgorithm := ‘aes’; crypt.EncodingMode := ‘base64’; OutPutStr := crypt.EncryptStringENC(StringToEncrypt); Answer: Strings in some programming languages such as Visual Basic, C#, VB.NET, Delphi, Foxpro, etc. should be thought of as objects.  The object contains a string (i.e. […]