'UDP'에 해당되는 글 1건

  1. 2015.05.22 Indy Send Unicode 문제

Embarcadero 2009 또는 XE 부터 Unicode 가 도입되면서

기존의  component 들 모두 Unicode 문제에 봉착.


Indy 에서 send / receive 할 때, 한글이 포함되면 ?

당연히 깨진다.


해결방법은 ?


보낼 때 : 

UnnicodeString strSend;

IdUDPClient1->Send(strSend, IndyTextEncoding_UTF8());


받을 때 :

void __fastcall TfrmUDP::IdUDPServer1UDPRead(TIdUDPListenerThread *AThread, TBytes AData, TIdSocketHandle *ABinding)

이 함수에다,

Unicodestring BData = BytesToString(AData, IndyTextEncoding_UTF8());


이렇게 처리해주면 된다.

1 

글 보관함

카운터

Total : / Today : / Yesterday :
get rsstistory!