aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/http/headers/accept-charset/index.html
blob: 9760f9ac93df94429e0727748a3b9bb2199e4577 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
title: Accept-Charset
slug: Web/HTTP/Headers/Accept-Charset
translation_of: Web/HTTP/Headers/Accept-Charset
---
<div>{{HTTPSidebar}}</div>

<p><strong><code>Accept-Charset</code></strong> 요청 HTTP 헤더는 클라이언트가 이해할 수 있는 캐릭터셋이 무엇인지를 알려줍니다. <a href="/en-US/docs/Web/HTTP/Content_negotiation">컨텐츠 협상</a>을 사용하여, 서버는 제안된 것 중 하나를 선택하고, 사용하며 {{HTTPHeader("Content-Type")}} 응답 헤더를 통해 선택된 캐릭터셋을 클라이언트에게 알려줍니다. 브라우저들은 각각의 컨텐츠 타입에 대한 기본 값이 일반적으로 정확하고 그것을 전송하는 것이 더 쉽게 행적을 남기게 될 가능성이 있으므로 이 헤더를 설정하지 않습니다.</p>

<p>서버가 일치하는 캐릭터셋을 서브하지 못할 경우, 이론적으로 {{HTTPStatus("406")}} (Not Acceptable) 오류 코드를 회신할 수 있습니다. 그러나, 더 나은 사용자 경험을 위해, 그런 경우는 드물며 더 일반적인 방법은 이런 경우 <code>Accept-Charset</code> 헤더를 무시하는 겁니다.</p>

<div class="note">
<p>HTTP/1.1 초기 버전에서는, 기본 캐릭터셋(<code>ISO-8859-1</code>)이 정의됐었습니다. 더 이상 실제로 그렇지 않으며 이제 각각의 컨텐츠 타입이 기본 값을 가지고 있을 수도 있습니다.</p>
</div>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">헤더 타입</th>
   <td>{{Glossary("Request header")}}</td>
  </tr>
  <tr>
   <th scope="row">{{Glossary("Forbidden header name")}}</th>
   <td>yes</td>
  </tr>
 </tbody>
</table>

<h2 id="문법">문법</h2>

<pre>Accept-Charset: &lt;charset&gt; // Multiple types, weighted with the {{glossary("quality values", "quality value")}} syntax: Accept-Charset: utf-8, iso-8859-1;q=0.5</pre>

<h2 id="디렉티브">디렉티브</h2>

<dl>
 <dt><code>&lt;charset&gt;</code></dt>
 <dd><code>utf-8</code> 혹은 <code>iso-8859-15</code>와 같은 캐릭터셋.</dd>
 <dt><code>*</code></dt>
 <dd>헤더 내 다른 곳에서 언급되지 않은 모든 캐릭터셋; 와일드카드로 사용되는<code>'*'.</code></dd>
 <dt><code>;q=</code> (q-인자 가중치)</dt>
 <dd><em>weight</em>라고 불리는 상대적 <a href="/en-US/docs/Glossary/Quality_values">품질 값</a>을 사용해 표현되는 선호도에 따라 대체되는 값.</dd>
</dl>

<h2 id="예제">예제</h2>

<pre>Accept-Charset: iso-8859-1

Accept-Charset: utf-8, iso-8859-1;q=0.5

Accept-Language: utf-8, iso-8859-1;q=0.5, *;q=0.1
</pre>

<h2 id="명세">명세</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">명세</th>
   <th scope="col">제목</th>
  </tr>
  <tr>
   <td>{{RFC("7231", "Accept-Charset", "5.3.3")}}</td>
   <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Context</td>
  </tr>
 </tbody>
</table>

<h2 id="브라우저_호환성">브라우저 호환성</h2>

<p class="hidden">이 페이지의 호환성 테이블은 구조화된 데이터로부터 생성되었습니다. 이 데이터에 기여하고자 한다면, <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>을 확인하고 pull request를 보내주세요.</p>

<p>{{Compat("http.headers.Accept-Charset")}}</p>

<h2 id="함께_참고할_내용">함께 참고할 내용</h2>

<ul>
 <li>HTTP <a href="/en-US/docs/Web/HTTP/Content_negotiation">컨텐츠 협상</a></li>
 <li>컨텐츠 협상 결과를 이용하는 헤더: {{HTTPHeader("Content-Type")}}</li>
 <li>다른 유사한 헤더들: {{HTTPHeader("TE")}}, {{HTTPHeader("Accept-Encoding")}}, {{HTTPHeader("Accept-Language")}}, {{HTTPHeader("Accept")}}</li>
</ul>