-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delphi 2007 #33
Comments
Option 1: Try explicit pre-conversion: Option 2: If one non-unicode codepage is enough, then try explicitly specifying that non-UTF-8 codepage when saving XLSX. This way, the Below is the code from Delphi 2006 project. The project uses Russian Windows codepage (1251).
Avemey, could you please put this snippet into some FAQ or at least mention in ReadMe ? |
Hi, I have solved implementing WideString support depending on define DELPHI_UNICODE in zsspxml.pas I have overloaded in ZEGetDefaultUTF8Converter I have bypassed @AnsiToUTF8 returning nil P.S. in zexmlss.pas Now it works like a charm in D2007 |
Since FPC is more important than Delphi to Avemey i do not think he would go that way. Also, using BSTR type means you multiplied memory use many times. We might expect that old Delphi is used on old computers, where RAM and CPU speed as not in such excess as on modern computers. Perhaps a correct way would be declaring a type like TZString, and mapping it to different real types, dependent upon compiler used. TZString=UnicodeString on Delphi 2009+, =AnsiString on Delphi 2007-, =UTF8String on FPC But even this would still mean RAM usage might get hugely multiplicated using WideString, so i wonder if that solution is universal.
For example i would definitely prohibit this in MY project |
In zsspxml.pas there is already the overloaded version conditioned by DELPHI_UNICODE define, I have only extended it. If DELPHI_UNICODE is defined string type is already WideString so, in zexmlss.pas, in TZCell class, changing: FData: string; with: {$IFDEF DELPHI_UNICODE} should not create a problem for newer Delphi. Also, putting invalid characters in an excel cell will result in an error when opening the document, so I think that filtering them should be done. #160 is the (non breaking space) but is invalid in excel cell, so in my opinion the choice is between filtering it or replacing with a normal space. |
Is it possible to set a cell to a unicode string value in delphi 2007 where string type is AnsiString?
MyWideString := 'сатри санҷиши юникод';
MyCell.AsString := MyWideString;
but in result xlsx MyCell will get '????? ??????? ??????'
The text was updated successfully, but these errors were encountered: