{"id":345,"date":"2005-12-28T10:10:10","date_gmt":"2005-12-28T01:10:10","guid":{"rendered":"https:\/\/terzeron.com\/2005\/12\/28\/%ed%83%9c%ed%84%b0%ed%88%b4%ec%a6%88%ec%9d%98-%eb%a6%ac%eb%8d%94%eb%b3%b4%ea%b8%b0-utf-8-%ec%a7%80%ec%9b%90-%ec%88%98%ec%a0%95-%eb%b2%84%ec%a0%84\/"},"modified":"2005-12-28T10:10:10","modified_gmt":"2005-12-28T01:10:10","slug":"%ed%83%9c%ed%84%b0%ed%88%b4%ec%a6%88%ec%9d%98-%eb%a6%ac%eb%8d%94%eb%b3%b4%ea%b8%b0-utf-8-%ec%a7%80%ec%9b%90-%ec%88%98%ec%a0%95-%eb%b2%84%ec%a0%84","status":"publish","type":"post","link":"https:\/\/terzeron.com\/?p=345","title":{"rendered":"[TatterTools] \ub9ac\ub354\ubcf4\uae30 UTF-8 \uc9c0\uc6d0 (\uc218\uc815 \ubc84\uc804)"},"content":{"rendered":"<p>\ud0dc\ud130\ud234\uc988 0.961 Countdown\uc5d0\uc11c \uc790\uccb4\uc801\uc73c\ub85c \uc81c\uacf5\ud558\ub294 RSS\ub9ac\ub354\ub294 \uc544\uc9c1\uae4c\uc9c0 \uc720\ub2c8\ucf54\ub4dc UTF-8 \uc778\ucf54\ub529\uc744 \uc9c0\uc6d0\ud558\uc9c0 \uc54a\uc544\uc11c, \ub300\ubd80\ubd84\uc758 wordpress \uae30\ubc18 \ube14\ub85c\uadf8\ub97c \uc77d\uc744 \uc218 \uc5c6\ub2e4\ub294 \ub2e8\uc810\uc774 \uc788\ub2e4.<\/p>\n<p>\uac04\ub2e8\ud558\uac8c UTF-8\uc744 \uc9c0\uc6d0\ud558\ub294 \ucf54\ub4dc \uc791\uc5c5\uc744 \ud574\ubd24\ub2e4.<\/p>\n<p>* \uc5b4\uc81c \uc791\uc131\ud55c \ucf54\ub4dc\uc5d0 \ubc84\uadf8\uac00 \uc788\uc5b4\uc11c tt_xml_parser_into_struct() \ud568\uc218\uc5d0 \ud55c \uc904 \ucd94\uac00\ud558\uc600\ub2e4. DB\uc5d0\uc11c &#8220;delete from t3_tts_rss_item;&#8221;\uc744 \uc2e4\ud589\ud558\uc5ec \uc218\uc9d1\ub418\uc5b4 \uc788\ub294 RSS \ud56d\ubaa9\uc744 \uc0ad\uc81c\ud558\uace0 \ub9ac\ub354\ubcf4\uae30\uc5d0\uc11c T\ub97c \ub20c\ub7ec \uc0c8\ub85c RSS\ub97c \uc218\uc9d1\ud55c\ub2e4.<\/p>\n<p>1) inc_function.php\uc758 xml_parser() \ud568\uc218\uc640 tt_xml_parser_into_struct() \ud568\uc218\ub97c \ubcc0\uacbd\ud55c\ub2e4.<\/p>\n<p>1. xml_parser()<\/p>\n<div style=\"padding: 10px; background-color: #f0f0f0\">function xml_parser($url, $mdate) {<br \/>\nif ($mdate == &#8220;0&#8221;) $mdate = &#8220;&#8221;;list($header, $body, $lmdate) = @get_remotefile($url, $mdate);<\/p>\n<p>$st = get_sock_status($header);<br \/>\n<span style=\"padding: 3px 1px 0pt; color: #202020; background-color: #c9edff\"> \/\/ modified by terzeron<br \/>\n$encoding = &#8220;&#8221;;<\/span><br \/>\nif ($st == 200) {<br \/>\n<span style=\"padding: 3px 1px 0pt; color: #202020; background-color: #c9edff\"> \/\/ modified by terzeron<br \/>\n\/\/if (strpos($body,&#8221;encoding=&#8221;UTF-8&#8243;&#8221;)) error_process(&#8220;02B5&#8221;);<br \/>\nif (strpos($body, &#8220;encoding=&#8221;UTF-8&#8243;&#8221;) or<br \/>\nstrpos($body, &#8220;encoding=&#8221;utf-8&#8243;&#8221;))<br \/>\n$encoding = &#8220;utf-8&#8221;;<\/span><br \/>\n$vals = tt_xml_parser_into_struct($body<span style=\"padding: 3px 1px 0pt; color: #202020; background-color: #c9edff\">, $encoding<\/span>);<br \/>\n}<br \/>\nreturn array($st, $header, $body, $lmdate, $vals);<br \/>\n}<\/div>\n<p>2. tt_xml_parser_into_struct()<\/p>\n<div style=\"padding: 10px; background-color: #f0f0f0\">function tt_xml_parser_into_struct($body<span style=\"padding: 3px 1px 0pt; color: #202020; background-color: #c9edff\">, $encoding<\/span>) {<br \/>\n$h_set = array();<br \/>\n$r_set = array();while ($n1 = strpos($body, &#8220;<!--[CDATA[\")) {\n$n2 = strpos($body, \"]]-->&#8220;);<br \/>\nif (!$n2 || $n1 > $n2) break;<br \/>\n$stamp = get_timestamp2();<br \/>\n$cval = substr($body, $n1+9, $n2-$n1-9);<br \/>\n<span style=\"padding: 3px 1px 0pt; color: #202020; background-color: #c9edff\"> \/\/ modified by terzeron<br \/>\n$temp_cval = $cval;<br \/>\nif ($encoding == &#8220;utf-8&#8221;)<br \/>\n$temp_cval = iconv(&#8220;utf-8&#8221;, &#8220;euc-kr&#8221;, $cval);<br \/>\n<\/span> $body = str_replace(&#8220;<!--[CDATA[\".$cval.\"]]-->&#8220;, $stamp, $body);<br \/>\n<span style=\"padding: 3px 1px 0pt; color: #202020; background-color: #c9edff\"> $h_set[$stamp] = trim($temp_cval);<br \/>\n<\/span> }<\/p>\n<p>$b_set = explode(&#8220;<\", $body);\n\nforeach ($b_set as $k => $row) {<br \/>\n$inp = array();<br \/>\n$att_set = array();<\/p>\n<p>$row = trim($row);<br \/>\nif (!$row) continue;<\/p>\n<p>if (substr($row,0,1)==&#8221;\/&#8221;) {<br \/>\nif (strpos($row, &#8220;item&#8221;)) { $inp[tag] = &#8220;ITEM&#8221;; $inp[type] = &#8220;close&#8221;; array_push($r_set, $inp); }<br \/>\ncontinue;<br \/>\n}<\/p>\n<p>list($tag_inf, $val) = explode(&#8220;>&#8221;, $row);<br \/>\n<span style=\"padding: 3px 1px 0pt; color: #202020; background-color: #c9edff\"> \/\/ modified by terzeron<br \/>\nif ($encoding == &#8220;utf-8&#8221;)<br \/>\n$val = iconv(&#8220;utf-8&#8221;, &#8220;euc-kr&#8221;, $val);<br \/>\n<\/span><\/p>\n<p>\uc774\ud558 \uc0dd\ub7b5<\/p><\/div>\n<p>2) \ucd94\uac00\uc801\uc73c\ub85c admin\/reader_opml_import.php\uc5d0\uc11c tt_xml_parser_into_struct() \ud568\uc218\ub97c \ud638\ucd9c\ud560 \ub54c, &#8220;&#8221; \ud30c\ub77c\ubbf8\ud130\ub97c \ud558\ub098 \ub354 \ucd94\uac00\ud574\uc918\uc57c \ud55c\ub2e4.<\/p>\n<div style=\"padding: 10px; background-color: #f0f0f0\">$xmlinfo = tt_xml_parser_into_struct($fvalue<span style=\"padding: 3px 1px 0pt; color: #202020; background-color: #c9edff\">, &#8220;&#8221;<\/span>);<\/div>\n<div class=\"fb-background-color\">\n\t\t\t  <div \n\t\t\t  \tclass = \"fb-comments\" \n\t\t\t  \tdata-href = \"https:\/\/terzeron.com\/?p=345\"\n\t\t\t  \tdata-numposts = \"100\"\n\t\t\t  \tdata-lazy = \"true\"\n\t\t\t\tdata-colorscheme = \"light\"\n\t\t\t\tdata-order-by = \"time\"\n\t\t\t\tdata-mobile=true>\n\t\t\t  <\/div><\/div>\n\t\t  <style>\n\t\t    .fb-background-color {\n\t\t\t\tbackground: #ffffff !important;\n\t\t\t}\n\t\t\t.fb_iframe_widget_fluid_desktop iframe {\n\t\t\t    width: 100% !important;\n\t\t\t}\n\t\t  <\/style>\n\t\t  ","protected":false},"excerpt":{"rendered":"<p>\ud0dc\ud130\ud234\uc988 0.961 Countdown\uc5d0\uc11c \uc790\uccb4\uc801\uc73c\ub85c \uc81c\uacf5\ud558\ub294 RSS\ub9ac\ub354\ub294 \uc544\uc9c1\uae4c\uc9c0 \uc720\ub2c8\ucf54\ub4dc UTF-8 \uc778\ucf54\ub529\uc744 \uc9c0\uc6d0\ud558\uc9c0 \uc54a\uc544\uc11c, \ub300\ubd80\ubd84\uc758 wordpress \uae30\ubc18 \ube14\ub85c\uadf8\ub97c \uc77d\uc744 \uc218 \uc5c6\ub2e4\ub294 \ub2e8\uc810\uc774 \uc788\ub2e4. \uac04\ub2e8\ud558\uac8c UTF-8\uc744 \uc9c0\uc6d0\ud558\ub294 \ucf54\ub4dc \uc791\uc5c5\uc744 \ud574\ubd24\ub2e4. * \uc5b4\uc81c \uc791\uc131\ud55c \ucf54\ub4dc\uc5d0 \ubc84\uadf8\uac00 \uc788\uc5b4\uc11c tt_xml_parser_into_struct() \ud568\uc218\uc5d0 \ud55c \uc904 \ucd94\uac00\ud558\uc600\ub2e4. DB\uc5d0\uc11c &#8220;delete &hellip; <a href=\"https:\/\/terzeron.com\/?p=345\">\uacc4\uc18d \uc77d\uae30 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[20],"tags":[],"class_list":["post-345","post","type-post","status-publish","format-standard","hentry","category-20"],"_links":{"self":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/posts\/345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=345"}],"version-history":[{"count":0,"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/posts\/345\/revisions"}],"wp:attachment":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}