crufl string problems (Delphi)
I use User function libraries (UFL's) to get language dependend texts for my report labels. I must use BSTR * (WideString) to define the function. If i define an other return type ( LPSTR ) the function is not visible at crystal reports. The problem is that when i use WideString the chinese symbols are not visible i see only some characters. I guess the problem is the wideString when i could use PChar it should work. Has anybody an idea how i could use PChar? or any other ideas?
The function looks like this but with PChar it's not visible at crystal reports.
function TLanguageModule.getText: PChar; begin Result := 'u4E2Du56FDu7684u7F51u9875'; // This are chinise characters end;
Edited by: SGE on Oct 9, 2008 9:04 AM
Don Williams replied
As of CR 9 we are now UNICODE compliant. We did not however update the UFL interface to also support UNICODE fully. Internally when string values are passed from the Designer to a UFL we "thunk" the value to "MBCS" format. In MS C++ this is "Multi Byte Character Set" When handling strings in your UFL you need to do the same. When the result is passed back to CR we then thunk it back to our internal UNICODE format. Unfortunately there may be some conversion loss. So use the equivolent in Delphi.
As long as you use a true UNICODE font like MS Arial Unicode this should work.
Also make sure you have all fonts intsalled and in Control Panel, Regional settings.... Advanced tab, Default User... check on Apply all settings... Under the Languages tab check on Install files for complex scripts also and if you need to the other option to install all East Asian fonts.