Unanswered: Powerbuilder10 sending arabic characters as ? to a VC++ DLL
We are using a PB client and entering data in arabic with PC regional settings as "English". The PB application calls VC++ DLL via an external function. When I see the string value in debug mode inside VC++ DLL function, these arabic characters become "????" and code as 3f.
The same string works fine if I set the regional setting of the PC as "Arabic".
1. In the VC++ DLL we have published a function "write_to_file" that expects a string from the frontend/PB. This string is printed to a txt file on the client machine.
extern "C" _declspec(dllexport) long _stdcall write_to_file(char * str)
FILE * fp = fopen("D:\\arabic_text.txt","w");
if (fp == NULL)
Observations: The static text string "str1" also has three arabic characters that are being being printed fine to the flat file. The problem is with the string that we receive from the PB window.
For the sake of simplicity I have sent the same three Arabic characters from the PB screen that I have hardcoded in the DLL.
Hence if in debug mode (VC++ DLL) I examine the memory location ( of string coming as input) and compare it with the contents of the static/hardcoded string str1, I can very clearly see that the character codes are different.