<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](abstract.xhtml "抽象對象層") | - [上一頁](reflection.xhtml "反射") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python/C API 參考手冊](index.xhtml) ? - [工具](utilities.xhtml) ? - $('.inline-search').show(0); | # 編解碼器注冊與支持功能 int `PyCodec_Register`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*search\_function*)注冊一個新的編解碼器搜索函數。 作為副作用,其嘗試加載 `encodings` 包,如果尚未完成,請確保它始終位于搜索函數列表的第一位。 int `PyCodec_KnownEncoding`(const char *\*encoding*)根據注冊的給定 *encoding* 的編解碼器是否已存在而返回 `1` 或 `0`。此函數總能成功。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_Encode`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*object*, const char *\*encoding*, const char *\*errors*)*Return value: New reference.*泛型編解碼器基本編碼 API。 *object* 使用 *errors* 定義的錯誤處理方法傳遞給定 *encoding* 的編碼器函數。 *errors* 可能是 *NULL* 以使用為編解碼器定義的默認方法。如果找不到編碼器,則拋出 [`LookupError`](../library/exceptions.xhtml#LookupError "LookupError")。 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_Decode`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*object*, const char *\*encoding*, const char *\*errors*)*Return value: New reference.*泛型編解碼器基本解碼 API。 *object* 使用 *errors* 定義的錯誤處理方法傳遞給定 *encoding* 的解碼器函數。 *errors* 可能是 *NULL* 以使用為編解碼器定義的默認方法。如果找不到編碼器,則拋出 [`LookupError`](../library/exceptions.xhtml#LookupError "LookupError")。 ## Codec lookup API In the following functions, the *encoding* string is looked up converted to all lower-case characters, which makes encodings looked up through this mechanism effectively case-insensitive. If no codec is found, a [`KeyError`](../library/exceptions.xhtml#KeyError "KeyError") is set and *NULL* returned. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_Encoder`(const char *\*encoding*)*Return value: New reference.*Get an encoder function for the given *encoding*. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_Decoder`(const char *\*encoding*)*Return value: New reference.*Get a decoder function for the given *encoding*. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_IncrementalEncoder`(const char *\*encoding*, const char *\*errors*)*Return value: New reference.*Get an [`IncrementalEncoder`](../library/codecs.xhtml#codecs.IncrementalEncoder "codecs.IncrementalEncoder") object for the given *encoding*. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_IncrementalDecoder`(const char *\*encoding*, const char *\*errors*)*Return value: New reference.*Get an [`IncrementalDecoder`](../library/codecs.xhtml#codecs.IncrementalDecoder "codecs.IncrementalDecoder") object for the given *encoding*. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_StreamReader`(const char *\*encoding*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*stream*, const char *\*errors*)*Return value: New reference.*Get a [`StreamReader`](../library/codecs.xhtml#codecs.StreamReader "codecs.StreamReader") factory function for the given *encoding*. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_StreamWriter`(const char *\*encoding*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*stream*, const char *\*errors*)*Return value: New reference.*Get a [`StreamWriter`](../library/codecs.xhtml#codecs.StreamWriter "codecs.StreamWriter") factory function for the given *encoding*. ## Registry API for Unicode encoding error handlers int `PyCodec_RegisterError`(const char *\*name*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*error*)Register the error handling callback function *error* under the given *name*. This callback function will be called by a codec when it encounters unencodable characters/undecodable bytes and *name* is specified as the error parameter in the call to the encode/decode function. The callback gets a single argument, an instance of [`UnicodeEncodeError`](../library/exceptions.xhtml#UnicodeEncodeError "UnicodeEncodeError"), [`UnicodeDecodeError`](../library/exceptions.xhtml#UnicodeDecodeError "UnicodeDecodeError") or [`UnicodeTranslateError`](../library/exceptions.xhtml#UnicodeTranslateError "UnicodeTranslateError") that holds information about the problematic sequence of characters or bytes and their offset in the original string (see [Unicode Exception Objects](exceptions.xhtml#unicodeexceptions) for functions to extract this information). The callback must either raise the given exception, or return a two-item tuple containing the replacement for the problematic sequence, and an integer giving the offset in the original string at which encoding/decoding should be resumed. Return `0` on success, `-1` on error. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_LookupError`(const char *\*name*)*Return value: New reference.*Lookup the error handling callback function registered under *name*. As a special case *NULL* can be passed, in which case the error handling callback for "strict" will be returned. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_StrictErrors`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*exc*)*Return value: Always NULL.*Raise *exc* as an exception. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_IgnoreErrors`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*exc*)*Return value: New reference.*Ignore the unicode error, skipping the faulty input. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_ReplaceErrors`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*exc*)*Return value: New reference.*Replace the unicode encode error with `?` or `U+FFFD`. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_XMLCharRefReplaceErrors`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*exc*)*Return value: New reference.*Replace the unicode encode error with XML character references. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_BackslashReplaceErrors`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*exc*)*Return value: New reference.*Replace the unicode encode error with backslash escapes (`\x`, `\u` and `\U`). [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyCodec_NameReplaceErrors`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*exc*)*Return value: New reference.*Replace the unicode encode error with `\N{...}` escapes. 3\.5 新版功能. ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](abstract.xhtml "抽象對象層") | - [上一頁](reflection.xhtml "反射") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python/C API 參考手冊](index.xhtml) ? - [工具](utilities.xhtml) ? - $('.inline-search').show(0); | ? [版權所有](../copyright.xhtml) 2001-2019, Python Software Foundation. Python 軟件基金會是一個非盈利組織。 [請捐助。](https://www.python.org/psf/donations/) 最后更新于 5月 21, 2019. [發現了問題](../bugs.xhtml)? 使用[Sphinx](http://sphinx.pocoo.org/)1.8.4 創建。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看