Page 1 of 1

Garbled

Posted: Wed Dec 31, 2014 8:10 am
by dbyoung
XLS[0].AsString[1,1] := '25°/38°'

excel : 25?38?

why?

Re: Garbled

Posted: Mon Jan 05, 2015 8:04 pm
by larsa
Hello

Do you uses an unicode delphi (D2009+)? If not, any non-ascii characters (the degree char) will be probably be wrong.

Re: Garbled

Posted: Tue Jan 20, 2015 4:24 am
by dbyoung
I USE Delphi2010

test:
open Delphi2010
new project
add TxlsReadWriteII5

in formcreate write code

procedure TForm1.FormCreate(Sender: TObject);
begin
xls[0].AsString[1, 1] := '±5 60°';
xls.SaveToFile('c:\aaa.xlsx');
end;

open c:\aaa.xlsx
garbled?

i garbled.

debug program

find problem in function

function TXc12DataSST.AddString(const AText: AxUCString): integer;

if IsUnicode(AText) then
P := MakeString(AText)
else
P := MakeCompressedString(AText);

this code , if IsUnicode(AText) then
is no unicode , run P := MakeCompressedString(AText);
mistaken

Re: Garbled

Posted: Thu Feb 26, 2015 12:48 pm
by nmh
Hi

I'm running Delhpi 2007 and when using XLSReadWriteII 4 we can write Excel files with non ASCII characters. Using version 5 some of the non ASCII texts are collapsed, so the same text is used for multiple cells.

The problem is the hash table in function TXc12DataSST.AddString(AText: AxUCString): integer.

The following call returns the same index for different strings.

Result := FHashTable.ValueOf(AText);

if we call

function TXc12DataSST.FileAddString(const AText: AxUCString): integer;

instead of TXc12DataSST.AddString everything works.

Would it be possible for you to update the code with compile directives to call FileAddString when running Delphi 2007 and older?

Nicolas

Re: Garbled

Posted: Fri Mar 06, 2015 8:34 am
by larsa
Hello

This is fixed in update 5.20.43

Don't use the suggested solution above. It has other consequences that make it a very bad idea.

Re: Garbled

Posted: Wed Mar 11, 2015 3:28 am
by dbyoung
ok,thank!