델마당에도 같은 질문을 올렸는데 여기서도 한번 여쭈어 봅니다
SOAP를 통한 문자전송을 만들고 있는데 영문은 제대로 휴대폰에 표시가 되는데
한글은 깨져서 나옵니다. 아마도 Encoding문자인것 같은데 어떻게 바꿔줘야 할지를
모르겠습니다.
WSDL 문서 일부분(chartset이 utf-8로 지정되어 있슴)
POST /SMS.v.5/ServiceSMS.asmx HTTP/1.1
Host: webservice.youiwe.co.kr
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "
http://webservice.youiwe.co.kr/SendSMS"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<SendSMS xmlns="
http://webservice.youiwe.co.kr/">
<smsID>string</smsID>
<hashValue>string</hashValue>
<senderPhone>string</senderPhone>
<receivePhone>string</receivePhone>
<smsContent>string</smsContent>
</SendSMS>
</soap:Body>
</soap:Envelope>
WSDL Importer Wizard에서 만들어준 함수(변수를 전부 widestring으로 받게 되어 있슴)
function SendSMS(const smsID: WideString; const hashValue: WideString; const
senderPhone: WideString; const receivePhone: WideString; const smsContent: WideString):
WideString; stdcall;
실행코드..
procedure TfrmSend.Button1Click(Sender: TObject);
var
msg : Widestring;
begin
...
...
msg := HTTPEncode(UTF8Encode('안녕'));
edResult.text := SMSSoap.SendSMS(Edit1.Text,str,Edit3.text,Edit4.Text, msg);
end;
msg 인코딩을 아래와 같이 바꾸어 보았을때 결과들입니다.
msg := '안녕'; // 받은문자 : ??????
msg := UTF8Encode('안녕'); // 받은문자 : ??????
msg := HTTPEncode(UTF8Encode('안녕')); // 받은문자 : %EC%95%88%EB%85%95
어떻게 해야 제대로 문자를 받아볼수 있을까요?