{"id":2065,"date":"2014-08-19T12:36:15","date_gmt":"2014-08-19T12:36:15","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=2065"},"modified":"2017-01-27T10:46:38","modified_gmt":"2017-01-27T01:46:38","slug":"javascript-utf-8-%ec%bd%94%eb%93%9c%ea%b0%92%ec%9c%bc%eb%a1%9c%eb%b6%80%ed%84%b0-string-%ea%b5%ac%ec%84%b1%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=2065","title":{"rendered":"[JavaScript] UTF-8 \ucf54\ub4dc\uac12\uc73c\ub85c\ubd80\ud130 String \uad6c\uc131\ud558\uae30"},"content":{"rendered":"<p><P>UTF-8\uc740 ASCII \ucf54\ub4dc\uac12\uc740 1\ubc14\uc774\ud2b8\ub85c, \uc720\ub7fd\uad8c \ubb38\uc790\ub294 2\ubc14\uc774\ud2b8\ub85c, \uc544\uc2dc\uc544\uad8c \ubb38\uc790\ub294 3\ubc14\uc774\ud2b8\ub85c \uad6c\uc131\ud568\uc73c\ub85c\uc368 \uc804\uc138\uacc4 \ubaa8\ub4e0 \uc5b8\uc5b4\ub97c \ucc98\ub9ac\ud560 \uc218 \uc788\ub294 \uc720\ub2c8\ucf54\ub4dc \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \uc800\ub294 \uae30\uc874\uc5d0 \ud3b8\uc758\uc0c1 EUC-KR\uc744 \uc0ac\uc6a9\ud588\uc73c\ub098 \uc774\uc81c\ubd80\ud130\ub294 UTF-8\uc744 \uba3c\uc800 \uace0\ub824\ud558\uace0 \uc0ac\uc6a9\ud574\uc57c\ud55c\ub2e4\uace0 \uc0dd\uac01\ud558\uac8c \ub418\uc5c8\uc2b5\ub2c8\ub2e4.<\/P><\/p>\n<p><P>\uc544\ub798\uc758 \ucf54\ub4dc\ub294 DataView \uac1d\uccb4\uc5d0 \uc800\uc7a5\ub41c UTF-8 \ucf54\ub4dc\uac12\uc73c\ub85c\ubd80\ud130 String\uc73c\ub85c \uad6c\uc131\ud558\ub294 \ucf54\ub4dc\uc785\ub2c8\ub2e4. \ubcc0\ud658 \uc18d\ub3c4\ub97c \uc704\ud574 \ub2e4\uc18c \ucf54\ub4dc\uac00 \ub09c\ud574 \ud569\ub2c8\ub2e4. \uc81c\uac00 \uac1c\ubc1c\ud55c \uc11c\ubc84\uc5d0\uc11c \ubb38\uc790\uc5f4 \ub370\uc774\ud130\ub97c UTF8\ub85c \uc778\ucf54\ub529\ub41c \ubc14\uc774\ub108\ub9ac \ub370\uc774\ud130\ub85c \uc6f9\ube0c\ub7ec\uc6b0\uc800\ub85c \ubcf4\ub0b4\uac8c \ub418\ub294\ub370 \uc774\ub54c \uc0ac\uc6a9\ud55c \ucf54\ub4dc\uc785\ub2c8\ub2e4.<\/P><\/p>\n<pre>\r\nfunction getStringUTF8(dataview, offset, length) {\r\n    var s = '';\r\n\r\n    for (var i = 0, c; i < length;) {\r\n        c = dataview.getUint8(offset + i++);\r\n        s += String.fromCharCode(\r\n            c > 0xdf && c < 0xf0 &#038;&#038; i < length - 1\r\n            ? (c &#038; 0xf) << 12 | (dataview.getUint8(offset + i++) &#038; 0x3f) << 6 \r\n            | dataview.getUint8(offset + i++) &#038; 0x3f\r\n            : c > 0x7f && i < length\r\n            ? (c &#038; 0x1f) << 6 | dataview.getUint8(offset + i++) &#038; 0x3f\r\n            : c\r\n        );\r\n    }\r\n    \r\n    return s;\r\n}\r\n<\/pre>\n<p><P>\uc9e7\uc740 \ucf54\ub4dc\uc774\uc9c0\ub9cc \uba87\uc77c \ub3d9\uc548 \uace0\ubbfc\ud558\uace0 \uace0\ubbfc\ud558\ub358 \ucc28\uc5d0 \ub9cc\ub09c... \uc800\uc5d0\uac8c\ub294 \ub9e4\uc6b0 \uc758\ubbf8\uc788\uace0 \uac12\uc9c4 \ucf54\ub4dc\uc785\ub2c8\ub2e4. ^^;<\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>UTF-8\uc740 ASCII \ucf54\ub4dc\uac12\uc740 1\ubc14\uc774\ud2b8\ub85c, \uc720\ub7fd\uad8c \ubb38\uc790\ub294 2\ubc14\uc774\ud2b8\ub85c, \uc544\uc2dc\uc544\uad8c \ubb38\uc790\ub294 3\ubc14\uc774\ud2b8\ub85c \uad6c\uc131\ud568\uc73c\ub85c\uc368 \uc804\uc138\uacc4 \ubaa8\ub4e0 \uc5b8\uc5b4\ub97c \ucc98\ub9ac\ud560 \uc218 \uc788\ub294 \uc720\ub2c8\ucf54\ub4dc \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \uc800\ub294 \uae30\uc874\uc5d0 \ud3b8\uc758\uc0c1 EUC-KR\uc744 \uc0ac\uc6a9\ud588\uc73c\ub098 \uc774\uc81c\ubd80\ud130\ub294 UTF-8\uc744 \uba3c\uc800 \uace0\ub824\ud558\uace0 \uc0ac\uc6a9\ud574\uc57c\ud55c\ub2e4\uace0 \uc0dd\uac01\ud558\uac8c \ub418\uc5c8\uc2b5\ub2c8\ub2e4. \uc544\ub798\uc758 \ucf54\ub4dc\ub294 DataView \uac1d\uccb4\uc5d0 \uc800\uc7a5\ub41c UTF-8 \ucf54\ub4dc\uac12\uc73c\ub85c\ubd80\ud130 String\uc73c\ub85c \uad6c\uc131\ud558\ub294 \ucf54\ub4dc\uc785\ub2c8\ub2e4. \ubcc0\ud658 \uc18d\ub3c4\ub97c \uc704\ud574 \ub2e4\uc18c \ucf54\ub4dc\uac00 \ub09c\ud574 \ud569\ub2c8\ub2e4. \uc81c\uac00 \uac1c\ubc1c\ud55c \uc11c\ubc84\uc5d0\uc11c \ubb38\uc790\uc5f4 \ub370\uc774\ud130\ub97c UTF8\ub85c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=2065\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;[JavaScript] UTF-8 \ucf54\ub4dc\uac12\uc73c\ub85c\ubd80\ud130 String \uad6c\uc131\ud558\uae30&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88],"tags":[],"class_list":["post-2065","post","type-post","status-publish","format-standard","hentry","category-javascript"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/2065","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2065"}],"version-history":[{"count":1,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/2065\/revisions"}],"predecessor-version":[{"id":2842,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/2065\/revisions\/2842"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2065"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}