title: TCP socket - sending control characters
body: <p>I am trying to connect by a TCP/IP protocol to a program that is not made in Delphi, and I have no documentation on how to do it.</p>
  
  <p>Using a service made in Delphi, I have monitored communication between two clients of the program, and write sendt text to a file, so I can play it back in my Delphi program.</p>
  
  <p>I managed to send several things, but the problem is when I have to give this text:</p>
  
  <pre><code>SOH NUL ÜÜ NUL ENQ NUL Data ENQ NUL NUL NUL SOH NUL NUL NUL NUL 557
  </code></pre>
  
  <p>I see that there are special characters in string parts, and am having trouble sending these data.</p>
  
  <p>I have tried to send it as a string and put the ASCII values but special characters are not working.</p>
  
  <p>Here is part of my code:</p>
  
  <pre><code>TCPClient := TIdTCPClient.Create(nil);
  TCPClient.Host := edtIP.Text;
  Memo1.Lines.Clear;
  
  TCPClient.Port := PORT;
  TCPClient.ConnectTimeout := 20000;
  TCPCliente.Connect;
  Memo1.Lines.Add('Conectado con el Sevidor');
  
  TCPClient.Socket.ReadTimeout := 20000;
  
  edtTextoEnvio.Text := edtVersion.Text+' '+edtIP.Text+' '+
        edtAlias.Text+' '+edtFuncion.Text+' 'edtPassword.Text;
  
  TCPClient.Socket.WriteLnRFC(edtTextoEnvio.Text, IndyTextEncoding_8Bit);
  Memo1.Lines.Add('Mensaje Enviado: '+edtTextoEnvio.Text);
  TextoRecibido := TCPCliente.Socket.ReadLn(IndyTextEncoding_8Bit);
  Memo1.Lines.Add('Mensaje Recibido: '+TextoRecibido);
  TCPCliente.Socket.WriteLnRFC(NUNProc, IndyTextEncoding_8Bit);
  Memo1.Lines.Add('Mensaje Enviado: '+NUNProc);
  
  envioMensaje:= Char(1)+ Char(0)+'ÜÜ'+ Char(0)+ Char(5)+Char(0)+'Data'+Char()5)+Char(0)+Char(0)+Char(0)+Char(1)+CHar(0)+Char(0)+Char(0)+Char(0)+'557';
  TCPCliente.Socket.WriteLnRFC(envioMensaje, IndyTextEncoding_8Bit); //here is the problem
  TextoRecibido := TCPCliente.Socket.ReadLn(IndyTextEncoding_8Bit);
  Memo1.Lines.Add('Mensaje Recibido: '+TextoRecibido);
  </code></pre>