Recent posts

Recent comments

Archive

Calender

«   2024/04   »
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

출처 : w3schools - XML Encoding(영문)


위 사이트의 내용을, 내맘대로 해석함. ─.─;;


XML Encoding

XML의 인코딩


XML documents can contain international characters, like Norwegian æøå, or French êèé.
To avoid errors, you should specify the encoding used, or save your XML files as UTF-8.

XML 문서에는, 노르웨이어인 æøå나 불어인 êèé와 같은, 다국어 문자를 넣을 수 있다.
에러를 막기 위해서는, XML 파일을 UTF-8로 저장을 하거나, 사용된 인코딩이 무엇인지를 정확히 적어넣어야 한다.


Character Encoding

문자 인코딩 (문자를 유니코드로 바꾸기)


Character encoding defines a unique binary code for each different character used in a document.
In computer terms, character encoding are also called character set, character map, code set, and code page.

문자 인코딩은, 문서에 사용된 각기 다른 문자에 대해서 각각 2진법 코드로 지정하고 있다.
컴퓨터 용어에서, 문자 인코딩은 문자 집합, 문자표, 코드 집합, 코드 페이지라고도 불린다.


The Unicode Consortium

유니코드 협회


The Unicode Consortium develops the Unicode Standard.
Their goal is to replace the existing character sets with its standard Unicode Transformation Format (UTF)

유니코드 협회에서는 유니코드의 국제 표준을 꾸준히 개발하고 있다.
그들의 목표는 기존의 문자 집합을, 표준 UTF(유니코드 변환 형식)으로 교체하는 것이다.


The Unicode Standard has become a success and is implemented in HTML, XML, Java, JavaScript, E-mail, ASP, PHP, etc. The Unicode standard is also supported in many operating systems and all modern browsers.

Unicode 표준은 html, xml, 자바, 자바스크립트, 이메일, asp, php 등에서 도입되었고, 성공적이었다.
또한 Unicode 표준은 대부분의 OS(operating system)와 최신 브라우저에서도 적용된다.


The Unicode Consortium cooperates
with the leading standards development organizations, like ISO, W3C, and ECMA.

유니코드 협회는 ISO, W3C, ECMA와 같은, 국제 표준화 개발을 이끌어 가고있는 기관들과 협력하고 있다.


The Unicode Character Sets

유니코드 문자 집합


Unicode can be implemented by different character sets.
The most commonly used encodings are UTF-8 and UTF-16.

유니코드는 각각의 서로 다른 문자 집합으로 실행될 수 있다.
가장 많이 사용되는 인코딩은 UTF-8과 UTF-16이다.


UTF-8 uses 1 byte (8-bits) to represent basic Latin characters, and two, three, or four bytes for the rest.

UTF-8에서는 기본 라틴 문자들을 나타낼 때에는 1바이트(8비트)를 사용하고, 나머지 문자는 2나 3, 4바이트를 쓴다.


UTF-16 uses 2 bytes (16 bits) for most characters, and four bytes for the rest.

UTF-16에서는 대부분의 문자(기본 다국어)들은 2바이트(16비트)를 사용하고, 그 외에는 4바이트를 쓴다.


UTF-8 = The Web Standard

웹 표준은 UTF-8이다.


UTF-8 is the standard character encoding on the web.
웹에서의 표준 문자 인코딩 방식은 UTF-8이다.


UTF-8 is the default character encoding for HTML5, CSS, JavaScript, PHP, SQL, and XML.
HTML5, CSS, JavaScript, PHP, SQL, XML에서, 문자 인코딩에 대한 기본값은 UTF-8이다.


XML Encoding


The first line in an XML document is called the prolog:
XML 문서에서 맨 첫줄을 “프롤로그”라고 부른다.


prolog : 서두, 서문, 선언문

 
<?xml version="1.0"?>
 

The prolog is optional. Normally it contains the XML version number.
프롤로그는 선택 사항이다. 일반적으로 XML의 버전 번호가 들어간다.


It can also contain information about the encoding used in the document.
This prolog specifies UTF-8 encoding:

문서에서 사용된 인코딩에 대한 정보를 넣기도 한다.
아래의 프롤로그에서는 UTF-8로 인코딩되었음을 알려주고 있다.

 
<?xml version="1.0" encoding="UTF-8"?>
 

The XML standard states that all XML software must understand both UTF-8 and UTF-16.
XML 표준에서는, XML용 소프트웨어가 UTF-8과 UTF-16을 둘 다 해석할 수 있어야 한다고, 명시되어 있다.


UTF-8 is the default for documents without encoding information.
인코딩에 대한 정보가 들어있지 않은 문서에 대해서는 그 기본값이 UTF-8이다.


In addition, most XML software systems understand encodings like ISO-8859-1, Windows-1252, and ASCII.

그외 추가적으로, 대부분의 XML용 소프트웨어 시스템은
ISO-8859-1과 Windows-1252, ASCII과 같은 인코딩을 해석한다.


XML Errors

XML 에서의 에러 (오류)


Most often, XML documents are created on one computer, uploaded to a server on a second computer,
and displayed by a browser on a third computer.

주로 XML 문서는,
첫번째 컴퓨터에서 만들어져서, 두번째 컴퓨터의 서버로 업로드되고,
세번째 컴퓨터의 브라우저에서 출력된다.


If the encoding is not correctly interpreted by all the three computers,
the browser might display meaningless text, or you might get an error message.

인코딩이 세 컴퓨터에서 모두 제대로 해석되지 않으면,
브라우저는 아무 의미없는(무의미한) 텍스트를 출력하거나, 오류 경고 메세지를 띄울 것이다.


For high quality XML documents, UTF-8 encoding is the best to use.
UTF-8 covers international characters, and it is also the default, if no encoding is declared.

양질의 (상태 좋은) XML 문서를 위해서는, UTF-8로 인코딩하는 것이 가장 좋은 방법이다.


Conclusion

결론


When you write an XML document:

XML 문서를 작성할 때에는


  • Use an XML editor that supports encoding
    인코딩이 적용되는 XML용 편집기를 사용하라.

  • Make sure you know what encoding the editor uses
    편집기가 사용하는 인코딩이 무엇인지 반드시 확인하라.

  • Describe the encoding in the encoding attribute
    인코딩 속성 부분에 인코딩에 대해서 적어넣어라.

  • UTF-8 is the safest encoding to use
    UTF-8이 가장 안전한 인코딩 방법이다.

  • UTF-8 is the web standard
    UTF-8이 웹표준이다.




이 글이 도움이 되셨나요? *^^*

'XML > w3schools' 카테고리의 다른 글

[ XML ] 9. XML 문서의 형식  (0) 2015.06.26
[ XML ] 8. XML 출력하기  (0) 2015.06.25
[ XML ] 6. XML Namespaces  (0) 2015.06.22
[ XML ] 5. XML 엘리먼트의 속성  (0) 2015.06.22
[ XML ] 4. XML의 엘리먼트  (0) 2015.06.21