On 26 Jan 2009, at 09:48, Guru Kathiresan wrote:

In windows wchar_t size is 2 so I thought I can pass a WideString type
casted with PWideChar.

In Mac ,size of wchar_t is 4 in the C library and the size of WideChar in
FPC is 2.

In that case how do we convert the 2 byte WideChar to 4 byte wchar_t string?

You can use this function from the system unit:
function WideStringToUCS4String(const s : WideString) : UCS4String;

And for the other way around:
function UCS4StringToWideString(const s : UCS4String) : WideString;


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to