- Posts: 51
- Thank you received: 0
- Forum
- CodeTyphon Studio
- CodeTyphon Studio Components and Libraries
- Networking Development
- Indy UDP Server: how to send/receive a non-english string?
×
Components and Libraries for Networking Development, discussions, problems and suggestions
Question Indy UDP Server: how to send/receive a non-english string?
- Roman
- Topic Author
- Offline
- Junior Member
-
Less
More
1 year 6 months ago #15389
by Roman
Indy UDP Server: how to send/receive a non-english string? was created by Roman
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:UDP is TIdUDPserver component.
Reception I do this:
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?
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;
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.
- Sternas Stefanos
-
- Offline
- Moderator
-
- Ex Pilot, M.Sc, Ph.D
1 year 6 months ago - 1 year 6 months ago #15391
by Sternas Stefanos
PilotLogic Architect and Core Programmer
Replied by Sternas Stefanos on topic Indy UDP Server: how to send/receive a non-english string?
Thanks Sir
please any test project ?
and
your CT version, your OS, etc.
please any test project ?
and
your CT version, your OS, etc.
PilotLogic Architect and Core Programmer
Last edit: 1 year 6 months ago by Sternas Stefanos.
Please Log in or Create an account to join the conversation.
- Roman
- Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 51
- Thank you received: 0
1 year 6 months ago #15396
by Roman
Replied by Roman on topic Indy UDP Server: how to send/receive a non-english string?
I am attaching a test project.
OS: Windows 10, build 10.0.18362 (Tested on the Windows 7 system - the same result)
OS: Windows 10, build 10.0.18362 (Tested on the Windows 7 system - the same result)
Attachments:
Please Log in or Create an account to join the conversation.
- Sternas Stefanos
-
- Offline
- Moderator
-
- Ex Pilot, M.Sc, Ph.D
1 year 6 months ago #15397
by Sternas Stefanos
PilotLogic Architect and Core Programmer
Replied by Sternas Stefanos on topic Indy UDP Server: how to send/receive a non-english string?
Thanks Sir
please give us time to test
please give us time to test
PilotLogic Architect and Core Programmer
Please Log in or Create an account to join the conversation.