According to https://jpsoft.com/help/tree.htm, the "tree" command uses the "U.S. English extended ASCII character set. If your system is configured for a different country or language, or if you use a font which does not include these line drawing characters, the connecting lines in the tree display may not appear correctly (or not appear at all) on your screen. To correct the problem, use /A, or configure the TCC to use a font which can display standard extended ASCII characters."
However, using the "/A" switch for "tree" is not a solution, because it's "tree"-specific; and I need to put any given DOS output in the EditorGadget, with the correct characters at all times. So it sounds like I need a U.S. English extended ASCII font for the EditorGadget, and surely Windows would come with one installed by default? I tried "Terminal" but it didn't help (see bottom of this post).
Code: Select all
OpenWindow(0,200,200,300,120,"test",#PB_Window_SystemMenu)
EditorGadget(0,10,10,280,100)
;SetGadgetFont(0,FontID(LoadFont(#PB_Any,"Terminal",8))) ; Worse!
dir$=Chr(34)+"C:\Program Files\Internet Explorer"+Chr(34)
flags=#PB_Program_Hide|#PB_Program_Open|#PB_Program_Read
p=RunProgram(GetEnvironmentVariable("comspec"),"/c tree "+dir$,"",flags)
While ProgramRunning(p)
If AvailableProgramOutput(p)
o$+ReadProgramString(p)+#CRLF$
EndIf
Wend
SetGadgetText(0,o$)
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
Output with "Terminal" as the font (shows 2 totally different fonts in the EditorGadget):