⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xml.encoding.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Character Encoding</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="xml.error-codes.html">Error Codes</a></div> <div class="next" style="text-align: right; float: right;"><a href="xml.examples.html">Examples</a></div> <div class="up"><a href="book.xml.html">XML Parser</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div> <h1>Character Encoding</h1> <p class="para">  PHP&#039;s XML extension supports the <a href="http://www.unicode.org/" class="link external">&raquo; Unicode</a> character set through  different <span class="glossterm">character encoding</span>s.  There are  two types of character encodings, <span class="glossterm">source  encoding</span> and <span class="glossterm">target encoding</span>.  PHP&#039;s internal representation of the document is always encoded  with <i>UTF-8</i>. </p> <p class="para">  Source encoding is done when an XML document is <a href="function.xml-parse.html" class="link">parsed</a>.  Upon <a href="function.xml-parser-create.html" class="link">creating an XML  parser</a>, a source encoding can be specified (this encoding  can not be changed later in the XML parser&#039;s lifetime).  The  supported source encodings are <i>ISO-8859-1</i>,  <i>US-ASCII</i> and <i>UTF-8</i>.  The  former two are single-byte encodings, which means that each  character is represented by a single byte.  <i>UTF-8</i> can encode characters composed by a  variable number of bits (up to 21) in one to four bytes.  The  default source encoding used by PHP is  <i>ISO-8859-1</i>. </p> <p class="para">  Target encoding is done when PHP passes data to XML handler  functions.  When an XML parser is created, the target encoding  is set to the same as the source encoding, but this may be  changed at any point.  The target encoding will affect character  data as well as tag names and processing instruction targets. </p> <p class="para">  If the XML parser encounters characters outside the range that  its source encoding is capable of representing, it will return  an error.   </p> <p class="para">  If PHP encounters characters in the parsed XML document that can  not be represented in the chosen target encoding, the problem  characters will be &quot;demoted&quot;.  Currently, this means that such  characters are replaced by a question mark. </p></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="xml.error-codes.html">Error Codes</a></div> <div class="next" style="text-align: right; float: right;"><a href="xml.examples.html">Examples</a></div> <div class="up"><a href="book.xml.html">XML Parser</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -