TurboPack / AsyncPro

Async Professional is a comprehensive communications toolkit for Embarcadero Delphi and C++Builder.
101 stars 51 forks source link

TAdTerminal can not support unicode #21

Closed jonahzheng closed 2 years ago

jonahzheng commented 2 years ago

AdTerminal1.WriteString(#$1B'[0m'#$1B'[01;34m你好'#$1B'[0mbbb'#$D#$A); U7VZ~2UYAP~OLO03ST6(M~7

romankassebaum commented 2 years ago

I added two functions WriteStringUTF8 and WriteBytes. Could you please try them?

jonahzheng commented 2 years ago

5$J5I4)CKC~XZL30NP)ITHB

` type TForm3 = class(TForm) AdTerminal1: TAdTerminal; AdVT100Emulator1: TAdVT100Emulator; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;

var Form3: TForm3;

implementation

{$R *.dfm}

procedure TForm3.Button1Click(Sender: TObject); begin AdTerminal1.WriteStringUTF8(#$1B'[0m'#$1B'[01;34m你好'#$1B'[0mbbb'#$D#$A); end;

end. `

romankassebaum commented 2 years ago

I looked at the TAdTerminal component and it seems that it is AnsiString based. Writing non ANSI chars is not possible.

jonahzheng commented 2 years ago

Yes, but I'm thinking about converting to Unicode. A project needs to display Unicode text. Do you have any suggestions?

romankassebaum commented 2 years ago

You have to replace all casts like string(AnsiString) and work with TBytes instead. This is a lot of work and would not be backward compatible.

Does this make sense fur such an old library?

jonahzheng commented 2 years ago

Thank you for your advice. You're right. I'll find another solution