°¡À»ÀÌ´Ù (ÀÌÇöö)
|
|
Áú¹® ¿Ã¸®°í, ±¸±Û°Ë»öÀ¸·Î 5ºÐ¸¸¿¡ ÇØ°áÁ¡À» ã¾Ò³×¿ä.
Å×½ºÆ®Çغ¸´Ï ¾ÆÁÖ Àß µ¿À۵˴ϴÙ. ^^
Àú°°Àº ¿øÀÎÀ¸·Î °í¹ÎÇϽô ºÐµé¿¡°Ô µµ¿òÀÌ µÇ°íÀÚ, ÇØ°á¹ýÀ» Àû¾ú½À´Ï´Ù.
Ãâó : http://bloodguy.tistory.com/entry/Delphi2009-IdHTTP-Indy10-%EC%97%90%EC%84%9C-UTF-8-%EC%9B%B9%ED%8E%98%EC%9D%B4%EC%A7%80-%ED%95%9C%EA%B8%80-%EA%B9%A8%EC%A7%90
2017-03-22 ¿ÀÀü 3:21:22
|
|
°¡À»ÀÌ´Ù (ÀÌÇöö)
|
|
Delphi2009 + IdHTTP (Indy10) ¿¡¼ UTF-8 À¥ÆäÀÌÁö ÇÑ±Û ±úÁü
¼Ò½ºÆÄÀÏ ÀÚüÀÇ ÀÎÄÚµùµµ UTF-8ÀÌ°í ÆäÀÌÁö¼¼Æõµ UTF-8ÀÏ °æ¿ì,
¾Æ·¡¿Í °°Àº ÇüÅ·Π°¡Á®¿À¸é µÊ.
function getURLContent(URL: String): String;
var
IdHTTP1: TIdHTTP;
Stream: TBytesStream;
begin
Result:='';
Stream := TBytesStream.Create;
IdHTTP1:=TIdHTTP.Create(nil);
try
IdHTTP1.Get(URL, Stream, []);
Result:=TEncoding.UTF8.GetString(Stream.Bytes, 0, Stream.Size);
finally
FreeAndNil(IdHTTP1);
FreeAndNil(Stream);
end;
end;
Áß¿äÇÑ °ÍÀº TEncoding
¾Æ·¡¿Í °°Àº property ¸¦ °¡Áö°í ÀÖÀ¸¹Ç·Î ÀÎÄÚµù¿¡ µû¶ó ÀûÀýÇÏ°Ô »ç¿ëÇÏ¸é µÉ µí.
TEncoding.ASCII - Returns an encoding for the ASCII character set.
TEncoding.BigEndianUnicode - Returns an encoding for the UTF-16 format with big-endian byte order.
TEncoding.Default - Returns an encoding for the operating system`s default ANSI code page.
TEncoding.Unicode - Returns an encoding for the UTF-16 format with little-endian byte order.
TEncoding.UTF7 - Returns an encoding for the UTF-7 format.
TEncoding.UTF8 - Returns an encoding for the UTF-8 format. 2017-03-22 ¿ÀÀü 3:22:20
|
|