[TIL] HTTP : The Definitive Guide "p372 ~ p375"

시윤·2025년 6월 6일

[TIL] Two Pages Per Day

목록 보기
146/146
post-thumbnail

Chapter 16. Internationalization

(해석 또는 이해가 잘못된 부분이 있다면 댓글로 편하게 알려주세요.)


✏️ 원문 번역


How Character Sets and Encodings Work

Let’s see what character sets and encodings really do.

  • 문자집합과 인코딩이 실제로 무엇을 하는지 살펴보겠습니다.

We want to convert from bits in a document into characters that we can display onscreen. But because there are many different alphabets, and many different ways of encoding characters into bits(each with advantages and disadvantages), we need a standard way to describe and apply the bits-to-character decoding algorithm.

  • 문서의 비트를 화면에 표시할 수 있도록 문자로 변환해야 한다고 가정해봅시다.

  • 문자가 다양하고 문자를 비트로 인코딩하는 방식 또한 다양하기 때문에 디코딩 알고리즘을 표현하고 적용하기 위한 표준이 필요합니다.

Bits-to-character conversions happen in two steps, as shown in Figure16-2:

• In Figure 16-2a, bits from a document are converted into a character code that identifies a particular numbered character in a particular coded character set. In the example, the decoded character code is numbered 225.

• In Figure 16-2b, the character code is used to select a particular element of the coded character set. In iso-8859-6, the value 225 corresponds to “ARABIC LETTER FEH.” The algorithms used in Steps a and b are determined from the MIME charset tag.

  • 비트-문자 변환은 Figure 16-2에 나타난 것처럼 두 단계를 거칩니다.

  • Figure 16-2a에서 문서의 비트들은 정의된 문자집합의 문자 코드로 변환되어 특정 번호의 문자를 식별합니다. 예시에서 디코딩된 문자 코드는 225입니다.

  • Figure 16-2b에서 문자 코드는 문자집합에서 특정 요소를 선택하는 데 사용됩니다. iso-8859-6에서 225는 아랍어 문자 "FEH"에 해당합니다. a단계와 b단계에서 사용되는 알고리즘은 MIME charset 태그에 의해 결정됩니다.

A key goal of internationalized character systems is the isolation of the semantics(letters) from the presentation (graphical presentation forms). HTTP concerns itself only with transporting the character data and the associated language and charset labels. The presentation of the character shapes is handled by the user’s graphics display software (browser, operating system, fonts), as shown in Figure 16-2c.

  • 국제화된 문자 시스템의 목표는 의미(문자)와 표현(시각적으로 표시되는 형태)를 분리시키는 것입니다.

  • HTTP는 문자 데이터와 관련 언어 및 문자집합 라벨을 전송하는 데만 관여합니다.

  • Figure 16-2c에 나타난 것처럼 문자의 형태를 표현하는 것은 사용자의 그래픽 디스플레이 소프트웨어(브라우저, 운영체제, 폰트 등)에 의해 제어됩니다.


The Wrong Charset Gives the Wrong Characters

If the client uses the wrong charset parameter, the client will display strange, bogus characters. Let’s say a browser got the value 225 (binary 11100001) from the body:

  • 만약 클라이언트가 잘못된 charset 파라미터를 사용하면, 클라이언트는 요상한 가짜 문자를 표시할 것입니다.

  • 브라우저가 본문으로부터 225(이진수 11100001)를 받았다고 가정해봅시다.

• If the browser thinks the body is encoded with iso-8859-1 Western European character codes, it will show a lowercase Latin “a” with acute accent:

  • 만약 브라우저가 해당 본문이 iso-8859-1 서유럽 문자 코드로 인코딩되었다고 생각한다면, á 로 표현될 것입니다.

• If the browser is using iso-8859-6 Arabic codes, it will show “FEH”:

  • 만약 브라우저가 iso-8859-6 아랍어 코드를 사용한다면, "FEH"로 표현될 것입니다.

• If the browser is using iso-8859-7 Greek, it will show a small “Alpha”:

  • 브라우저가 iso-8859-7 그리스어를 사용하고 있다면 소문자 "alpha"가 나타날 것입니다.

• If the browser is using iso-8859-8 Hebrew codes, it will show “BET”:

  • 브라우저가 iso-8859-8 히브리어 코드를 사용하는 경우에는 "BET" 문자가 표시될 것입니다.

Standardized MIME Charset Values

The combination of a particular character encoding and a particular coded character set is called a MIME charset. HTTP uses standardized MIME charset tags in the Content-Type and Accept-Charset headers. MIME charset values are registered with the IANA.* Table 16-1 lists a few MIME charset encoding schemes used by documents and browsers. A more complete list is provided in Appendix H.

  • 특정 인코딩 기법과 문자집합의 조합을 MIME charset이라고 부릅니다.

  • HTTP는 Content-Type 헤더와 Accept-Charset 헤더에 표준화된 MIME charset 태그를 사용합니다.

  • MIME charset 값은 IANA에 등록되어 있습니다.

  • Table 16-1은 문서와 브라우저에서 사용되는 몇 가지 MIME charset 인코딩 기법을 나열하고 있습니다.

  • 더 자세한 목록은 Appendix H에서 확인하실 수 있습니다.


✏️ 요약


How Character Sets and Encodings Work

    1. 문서의 비트를 문자집합의 숫자 코드로 디코딩
    1. 그래픽 디스플레이 소프트웨어에서 숫자 코드를 문자 형태로 표현

Standardized MIME Charset

: IANA에 등록되어 있는 표준 (인코딩, 문자집합) 조합

  • Content-Type 헤더와 Accept-Charset 헤더에서 사용
  • us-ascii, utf-8 등

✏️ 감상


IANA(Internet Assigned Numbers Authority)

IANA는 도대체 뭘 하는 곳일까..?! IANA는 사실 MIME charset에 대한 표준을 관리하는 것만이 목적인 기관은 아니다. 이곳은 무려 HTTP에서 사용하는 MIME charset을 비롯한 인터넷 할당 번호를 전반적으로 관리하는 기관이다. IANA가 관리하는 가장 대표적인 번호가 바로 IP 주소와 최상위 도메인이다.

몰랐다면 이제 알아두자. 우리는 IANA가 없으면 인터넷을 정상적으로 못 쓴다...ㅋㅋㅋㅋㅋㅋ 굉장히 굉장히 중요한 기관이다.

profile
틈틈이 두 페이지씩 원서 읽기

0개의 댓글