PDA

View Full Version : WideString -> AnsiString -> WideString in Delphi/FPC?



cronodragon
21-02-2008, 03:20 PM
I'm playing around with Unicode support for my applications. Found these functions to convert between string formats:

http://www.swissdelphicenter.ch/torry/showcode.php?id=1692

It uses WideCharToMultiByte(). My first doubt is what Code Page should I use that gives the most compatibility? And also, how does FPC manages WideStrings? Does it make automatic conversion? :?

Thanks!
-Marco

Robert Kosek
22-02-2008, 11:28 PM
Unless I'm mistaken, I thought that FPC had "WideCharToString" and vice versa. I don't know how you would change between WideChar and WideString though. You could always use "WideCharToStringLen" to explicitly name the length.