Welcome, Guest
Username: Password: Remember me
Components and Libraries for Networking Development, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

Indy UDP Server: how to send/receive a non-english string? 3 years 10 months ago #15389

  • Roman
  • Roman's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 102
  • Thank you received: 0
I am using TIdUDPserver to send and receive strings. The transmission and reception of strings is carried out on one computer in different applications.

Sending I do this:
procedure TForm1.Broadcast(Msg : String; Param : string);
begin
  if Param <> '' then
    Msg += ':' + Param;
  if UDP.Active then
    UDP.Broadcast(Msg, 9999);
end;
UDP is TIdUDPserver component.

Reception I do this:
procedure TForm1.UDPUDPRead(AThread : TIdUDPListenerThread; const AData : TIdBytes; ABinding : TIdSocketHandle);
begin
  case ABinding.Port of
    9999:
      Label1.Caption := BytesToString(aData);
  end;
end;

Everything works as long as I use English text. If I send Russian text, I receive garbage:
Sent 'Hello!' --- Received 'Hello!'
Sent 'Привет' --- Received '??????'

I don't understand where, when and how does Indy recode the strings? What should be done to transmit / receive strings without problems?

Please Log in or Create an account to join the conversation.

Indy UDP Server: how to send/receive a non-english string? 3 years 10 months ago #15391

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
Thanks Sir
please any test project ?
and
your CT version, your OS, etc.
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Indy UDP Server: how to send/receive a non-english string? 3 years 10 months ago #15396

  • Roman
  • Roman's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 102
  • Thank you received: 0
I am attaching a test project.

File Attachment:

File Name: TEST.zip
File Size:5 KB


OS: Windows 10, build 10.0.18362 (Tested on the Windows 7 system - the same result)

Please Log in or Create an account to join the conversation.

Indy UDP Server: how to send/receive a non-english string? 3 years 10 months ago #15397

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
Thanks Sir
please give us time to test
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

  • Page:
  • 1