Start new project, add these functions:
function ByteToBits(B: Byte): String;
var
I: Integer;
N: Byte;
begin
Result := '';
for I := 1 to 8 do begin
Result := IntToStr(B and 1) + Result;
B := B shr 1;
end;
end;
function CharToBits(C: Char): String;
begin
Result := ByteToBits(Byte(C));
end;
Now, put three items on the form: Edit, ListBox and Button.
To test it, put this in button's OnClick event:
{ This first character in Edit box is converted to its binary presentation }
procedure TForm1.Button1Click(Sender: TObject);
begin
if Length(Edit1.Text) > 0 then
ListBox1.AddItem(CharToBits(Edit1.Text[1]), nil)
else begin
MessageDlg('Type something in edit box!', mtError, [mbOk], 0);
Edit1.SetFocus;
end;
end;
Note: If the character in edit box needs more than one byte in utf8 presentation (that is, if it is non-latin or accented character), then only the first byte will be shown.