Garbled

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
dbyoung
Posts: 7
Joined: Fri Jun 06, 2014 12:35 am

Garbled

Post by dbyoung »

XLS[0].AsString[1,1] := '25°/38°'

excel : 25?38?

why?
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Garbled

Post by larsa »

Hello

Do you uses an unicode delphi (D2009+)? If not, any non-ascii characters (the degree char) will be probably be wrong.
Lars Arvidsson, Axolot Data
dbyoung
Posts: 7
Joined: Fri Jun 06, 2014 12:35 am

Re: Garbled

Post 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
nmh
Posts: 1
Joined: Thu Feb 26, 2015 12:36 pm

Re: Garbled

Post 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
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Garbled

Post 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.
Lars Arvidsson, Axolot Data
dbyoung
Posts: 7
Joined: Fri Jun 06, 2014 12:35 am

Re: Garbled

Post by dbyoung »

ok,thank!
Post Reply