Take the 2-minute tour ×

ive a news server Built on Delphi7, using Indy9 TIdTCPServer, and the clients are using TClientSocket from ScktComp for size, and the traffic is encrypted in RC4 (string)

what exactly do i need to make my app work on XE or 2010 with Unicode support? what of these things will i have to change?

share|improve this question
add comment

3 Answers

up vote -3 down vote accepted

First you will have to TAKE CARE of the STRINGS by default STRING type is WideString this means that each character has 2 bytes -- for fast migration I would recommend replacing all "string" occurrences with AnsiString and then step by step update parts of the code to provide Unicode support. KEEP IN MIND that Indy is the part where you will have to work a lot, BUT you're lucky because you can search SO for answers to your issues...

share|improve this answer
No, that's exactly the WRONG way to approach it. Most of the code that will have an issue is code that assumes that a Char = 1 byte, and that code the compiler will warn you about and you can fix or adjust as needed. The other common area of problems is where someone has incorrectly used a character buffer as a holder for binary data. The right way is to compile your code AS IS, and deal with any issues that specifically need to be fixed. And Indy 10 doesn't need to be fixed at all for Unicode, as the latest is fixed already; you just have to fix the incompatibilities between Indy 9 and 10. –  Ken White Nov 12 '10 at 18:03
String is not WideString in Delphi 2009. It is the new UnicodeString type that is reference counted and copy-on-write as the old AnsiString is. –  Andreas Hausladen Nov 12 '10 at 18:20
i did as Mr. Mohammed Nasman said, im moving to Indy10 First, so, next step is try to compile under XE and replace all the needed strings with UnicodeString? i dont think thats all, is there any tutorial or article that can help me doing this? –  killercode Nov 13 '10 at 1:51
@killercode: Not quite. <g> In D2009 and up, "string" = "UnicodeString", so for the most part you don't have to replace anything. Re-read my comment above. Also, try here: edn.embarcadero.com/article/40307 or the 3-part series by Nick Hodges starting at dn.codegear.com/article/38437 –  Ken White Nov 13 '10 at 16:51
add comment

Unicode has introduced in Delphi 2009, so if you want the unicode support you can do it with Delphi 2009.

But if you are going to upgrade, get the latest one, you can get all the benefits of Delphi 2010 with less bugs and more Third party tools bundled with Delphi XE.

the other problem may you face is the translation between Indy 9 to Indy 10, because unicode support added to Indy 10, but also it's not 100% compatible with Indy 9.

I suggest you to try to compile your application with Delphi 7 and Indy 10, then move later to Delphi XE with Indy 10.

share|improve this answer
ok, but i heard indy10 is still unstable ??!! –  killercode Nov 12 '10 at 14:02
the bundled version of indy 9 and indy 10 has some bugs, but you can get it directly from indyproject website which has much better version than the bundled one. –  Mohammed Nasman Nov 12 '10 at 14:27
killercode: you heard wrong. –  Marco van de Voort Nov 12 '10 at 15:28
add comment

Don't know if Indy 9 is still supported on XE and 2010. Indy 10 has improvements but also some breaking changes. Moving binary data into strings is IMHO never a good choice, but depending the situation it could just need some minor changes. What you exactly need depends on your application code - without actually looking at it is difficult to say. All string manipulation routine should be checked, especially if you use them as low-level binary buffers, and the select which path is best to port them to the Unicode world.

share|improve this answer
for example : result := RC4(memo1.text, 'password');, im using bare strings, dunno if thats what u mean? –  killercode Nov 12 '10 at 13:30
1) Memo1.text will be UnicodeString. 2) The constant password as well, as result, if it is of type string. Is the RC4 function able to cope with that? –  user160694 Nov 12 '10 at 18:30
@killercode: encryption functions like RC4 and hashing functions like MD5 are not meant to be run on strings; they are meant to hash bytes. Make sure you get the same array of bytes in Delphi 7 and your Unicode Delphi, and the encryption and hashing will work fine. Even running them on strings will fail in non-unicode Delphi versions (like Delphi 7) if you use them with 'high-bit non ASCII' characters on systems with different character encodings. –  Jeroen Wiert Pluimers Nov 12 '10 at 21:21
r u pointing that they will work better under Unicode Versions of delphi? –  killercode Nov 13 '10 at 1:52
Indy 9 DOES NOT support D2009 and later, and never will. –  Remy Lebeau Nov 18 '10 at 3:20
add comment

Your Answer


