Fixes for reading and write SIL file in Delphi 2009/2010

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
suri
Posts: 2
Joined: Fri Mar 24, 2006 8:04 pm

Fixes for reading and write SIL file in Delphi 2009/2010

Post by suri »

I've been struggling to understand why SIL (with StoreASUTF8=True) is not maintaining the far-east language format properly in Delphi 2009/2010 even with the latest version of TsiLang. Then after examining the source codes, I realize that TEncoding.UTF8 needs to be included when calling LoadFromStream and SaveToStream. This is necessary when working with Delphi 2009/2010.

To Fix this, you will need to:
1. always set StoreASUTF8 to True (since this fix will only read and write SIL in UTF8)
2. in siComp.pas change the following (you may want to add conditional define to apply this fix to only delphi 2009/2010):
-Search for tmpLst.LoadFromStream(AStream); and replace it with tmpLst.LoadFromStream(AStream, TEncoding.UTF8);
-tmpLst.SaveToStream(AStream); and replace it with tmpLst.SaveToStream(AStream, TEncoding.UTF8);
3. You will need to recompile both design time and runtime package since runtime package is used by siLang Wizard in Delphi IDE.

Note to Igor: I've sent you the siComp.pas fixes awhile ago, but, don't know if you get it or not. If you want me to send the fixes to you again please let me know. Please fix this issue, so, I don't have to keep on patching it.

Suri
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hello,

Yes, I've received your email. It looks like my answer wasn't received. Anyway, thank you for your fix. But it may break the compatability for SIL files for earlier versions of Delphi. We will check this and include the fix for this in next update.
Best regards,
Igor Siticov.
Post Reply