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());
이렇게 처리해주면 된다.
'할거리 > BC' 카테고리의 다른 글
[ilink32 Error] Error: Unresolved external 'wWinMain' referenced from C0W32W.OBJ (0) | 2015.07.16 |
---|---|
BC++ Enable Debugging (0) | 2015.06.18 |
W1010 Method '%s' hides virtual method of base type '%s' (Delphi) (0) | 2015.05.29 |
ExtractStrings의 버그를 SeparateStrings 으로 해결 (0) | 2015.05.14 |
E2034 Cannot convert 'char const[17]' to 'const wchar_t *' (0) | 2015.05.11 |