01-10-2023, 02:57 AM
Thanks rlebeau! That was a great description of what was causing the underlying issue, and setting DefAnsiEncoding solved the problem. While searching for solutions I saw references to Delphi 5 being pre-Unicode and suspected that was related but I wasn't able to put it all together, and I didn't notice the DefAnsiEncoding property.
I am working on a app that has been deployed to end users for many years and I'm just trying to tweak it to add SSL for secure communication. The app has a complex, home grown protocol for sending text and formatting codes to the server which is not something I want to mess with for now. But you are correct, I double checked the comments and it is indeed using UTF-8 so I have set both DefAnsiEncoding and DefStringEncoding to IndyTextEncoding_UTF8 which seems to work just fine.
I have not looked at the server code at all but I believe it is written in Java. In any case, it is already setup to handle the UTF-8 text and codes sent by the client.
Believe me, I would love to work with the latest Delphi version! But this is a Delphi 5 app which is already deployed so that is where I need to start. One of the other items to address is to upgrade to a modern Delphi version but that seems like a big project so it may be awhile. If you have any suggestions/resources for upgrading an app from Delphi 5 feel free to share them! I think I read that the new versions of Delphi include Indy and the old TCP classes are deprecated, so I'm hoping that the switch to Indy is a step in the right direction in terms of upgrading (as well as adding SSL capabilities).
Thanks again for your help!
-Ed
Quote:Why are you using the 8bit encoding at all, instead of, say, UTF-8 instead?
I am working on a app that has been deployed to end users for many years and I'm just trying to tweak it to add SSL for secure communication. The app has a complex, home grown protocol for sending text and formatting codes to the server which is not something I want to mess with for now. But you are correct, I double checked the comments and it is indeed using UTF-8 so I have set both DefAnsiEncoding and DefStringEncoding to IndyTextEncoding_UTF8 which seems to work just fine.
Quote:Whatever you decide, you will have to replicate the same setup on the server side, too. Is it also written in Delphi 5?
I have not looked at the server code at all but I believe it is written in Java. In any case, it is already setup to handle the UTF-8 text and codes sent by the client.
Quote:Why are you starting out with an outdated version of Delphi that is 23.5 years old, instead of using a modern, up-to-date version?
Believe me, I would love to work with the latest Delphi version! But this is a Delphi 5 app which is already deployed so that is where I need to start. One of the other items to address is to upgrade to a modern Delphi version but that seems like a big project so it may be awhile. If you have any suggestions/resources for upgrading an app from Delphi 5 feel free to share them! I think I read that the new versions of Delphi include Indy and the old TCP classes are deprecated, so I'm hoping that the switch to Indy is a step in the right direction in terms of upgrading (as well as adding SSL capabilities).
Thanks again for your help!
-Ed