login about faq

I am trying to open a certificate store using the following command in Purebasic. It fails but when I check the log all I see is a single "C" for the last error text. It is the same when I use the debug command to display the last error text. I am using Windows 10 and Purebasic 5.32(x64). I am able to open the certificale store using Portecle so the certificate store is not corrupt and the password is correct.

loCertStore = CkCertStore::ckCreate()
If CkCertStore::ckLoadPfxFile(loCertStore,"kfs.pfx",#dCCertStorePwd) = 0
   WriteToLog("CkCertStore::ckLoadPfxFile("+CkCertStore::ckLastErrorText(loCertStore)+")")
   CkCertStore::ckDispose(loCertStore)
EndIf

asked Aug 25 '15 at 11:20

swapna's gravatar image

swapna
1113

edited Aug 25 '15 at 11:21


Chilkat returns Unicode strings, so that means PureBasic apps using Chilkat should be compiled in Unicode Mode.

To check if the program is compiled in "Unicode mode", you can use the compiler directives with #PB_Compiler_Unicode constant. To compile a program in "Unicode mode" the related option can be set in the Compiler options.

A telltale sign of having Unicode but interpreting the bytes as ANSI (one byte per char), is that you see the 1st char but the 2nd byte of the Unicode (utf-16) is 0, and this is taken as the terminating null of an ANSI string.

link

answered Aug 25 '15 at 22:17

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

That was the problem. I turned unicode on and everything worked as expected. Thank-you

(Aug 25 '15 at 22:24) swapna
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×4

Asked: Aug 25 '15 at 11:20

Seen: 1,792 times

Last updated: Aug 25 '15 at 22:24

powered by OSQA