Thanks for figuring that out.  

I get uFileVirtualTree.pas(533,9) Error: identifier idents no member 
"DefaultEncoding"
For line:    sl.DefaultEncoding:= TEncoding.GetEncoding(850);  

If I just comment out that line, it works fine for me, because I'm codepage 850 
anyway, but that doesn't help anyone else who may not be on 850

I’m getting this now:  (not sure if the box characters will come though 
everyone’s email but they look right on my email)

M: = 32:34
├───Project1 = 18:30
│   │───File1 = 8:32
│   ├───File2 = 7:43
│   └───File3 = 2:15
└───Project2 = 14:04
    └───Component1 = 14:04
        ├───Part1 = 5:32
        └───Part2 = 8:32

It has the incorrect character in front of File1,   It’s a vertical_line_char 
instead of a crossing_char.

I get the same thing on my large ini file.. and there is a pattern… the last 
two files on a branch are always correct, and everything above that are not.. 
they are using the vertical line instead of a crossing character.. so if there 
are 7 files in the branch, the first 5 will be vertical lines , the 6th one 
will be the correct crossing character and the 7th will be the correct angle 
character.

Thank you again for the help!

James 
-----Original Message-----
From: fpc-pascal <fpc-pascal-boun...@lists.freepascal.org> On Behalf Of Jean 
SUZINEAU via fpc-pascal
Sent: Saturday, April 17, 2021 8:07 PM
To: fpc-pascal@lists.freepascal.org
Cc: Jean SUZINEAU <jean.suzin...@wanadoo.fr>
Subject: Re: [fpc-pascal] Directory Tree

In Unicode/UTF8 "char" can be represented by several bytes so my code won't 
work.

It seems you use page code 850 (here in France we are in 1252 which doesn't 
have the box chars).

In unit uFileVirtualTree line 469, I have added   type String850= type 
String(850); declared the local variable s of String850 on line 488,

and changed on line 533 the default encoding of the Stringlist to 850 by 
sl.DefaultEncoding:= TEncoding.GetEncoding(850);

It seems to be sufficient to get the box characters. I didn't dig further but 
it seems to work either on Windows and Linux and in text file generated.

In the ODT file I used a numbered list but  I think it will be difficult to get 
something closer to a tree.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org 
<mailto:fpc-pascal@lists.freepascal.org>  
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to