{"id":1096732,"date":"2025-01-08T15:04:25","date_gmt":"2025-01-08T07:04:25","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1096732.html"},"modified":"2025-01-08T15:04:28","modified_gmt":"2025-01-08T07:04:28","slug":"python%e5%a6%82%e4%bd%95%e5%b0%86%e6%b1%89%e5%ad%97%e5%8f%98%e6%88%90asc%e7%a0%81-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1096732.html","title":{"rendered":"python\u5982\u4f55\u5c06\u6c49\u5b57\u53d8\u6210asc\u7801"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24211821\/746015fc-26d6-4ba1-b83d-240b145149e2.webp\" alt=\"python\u5982\u4f55\u5c06\u6c49\u5b57\u53d8\u6210asc\u7801\" \/><\/p>\n<p><p> <strong>Python\u5c06\u6c49\u5b57\u8f6c\u6362\u4e3aASCII\u7801\u7684\u65b9\u6cd5\u6709\u51e0\u79cd\uff1a\u4f7f\u7528<code>ord()<\/code>\u51fd\u6570\u3001\u4f7f\u7528<code>encode()<\/code>\u51fd\u6570\u3001\u7ed3\u5408<code>hex()<\/code>\u51fd\u6570\u6216\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u3002<\/strong> \u4e0b\u9762\u6211\u4eec\u8be6\u7ec6\u4ecb\u7ecd\u5176\u4e2d\u4e00\u79cd\u65b9\u6cd5\uff1a\u4f7f\u7528<code>ord()<\/code>\u51fd\u6570\u7ed3\u5408<code>hex()<\/code>\u51fd\u6570\uff0c\u53ef\u4ee5\u5c06\u6c49\u5b57\u5b57\u7b26\u8f6c\u6362\u4e3a\u76f8\u5e94\u7684ASCII\u7801\u8868\u793a\u5f62\u5f0f\u3002<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528<code>ord()<\/code>\u51fd\u6570\uff1a<\/strong> <\/p>\n<p><code>ord()<\/code>\u51fd\u6570\u53ef\u4ee5\u5c06\u4e00\u4e2a\u5b57\u7b26\u8f6c\u6362\u4e3a\u5176\u5bf9\u5e94\u7684Unicode\u7801\u70b9\uff08\u6574\u6570\uff09\u3002\u5bf9\u4e8e\u6c49\u5b57\u5b57\u7b26\uff0c<code>ord()<\/code>\u51fd\u6570\u8fd4\u56de\u5176\u5bf9\u5e94\u7684Unicode\u7801\u70b9\u503c\u3002\u7136\u540e\uff0c\u53ef\u4ee5\u7ed3\u5408<code>hex()<\/code>\u51fd\u6570\u5c06\u5176\u8f6c\u6362\u4e3a\u5341\u516d\u8fdb\u5236\u8868\u793a\u5f62\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u793a\u4f8b\u4ee3\u7801<\/p>\n<p>chinese_char = &#39;\u6c49&#39;<\/p>\n<p>ascii_code = ord(chinese_char)<\/p>\n<p>ascii_hex = hex(ascii_code)<\/p>\n<p>print(f&#39;\u6c49\u5b57 &quot;{chinese_char}&quot; \u7684ASCII\u7801\u662f\uff1a{ascii_hex}&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>ord()<\/code>\u51fd\u6570\u5c06\u6c49\u5b57\u5b57\u7b26<code>&#39;\u6c49&#39;<\/code>\u8f6c\u6362\u4e3a\u5176\u5bf9\u5e94\u7684Unicode\u7801\u70b9\u503c\uff0c\u7136\u540e<code>hex()<\/code>\u51fd\u6570\u5c06\u5176\u8f6c\u6362\u4e3a\u5341\u516d\u8fdb\u5236\u8868\u793a\u5f62\u5f0f\u3002<\/p>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u51e0\u79cd\u5176\u4ed6\u65b9\u6cd5\uff0c\u5e76\u8be6\u7ec6\u89e3\u91ca\u8fd9\u4e9b\u65b9\u6cd5\u7684\u4f7f\u7528\u6b65\u9aa4\u548c\u6ce8\u610f\u4e8b\u9879\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u4f7f\u7528<code>ord()<\/code>\u51fd\u6570<\/h2>\n<\/p>\n<p><p><code>ord()<\/code>\u51fd\u6570\u662fPython\u5185\u7f6e\u51fd\u6570\u4e4b\u4e00\uff0c\u5b83\u53ef\u4ee5\u5c06\u4e00\u4e2a\u5b57\u7b26\u8f6c\u6362\u4e3a\u5176\u5bf9\u5e94\u7684Unicode\u7801\u70b9\u503c\u3002\u5bf9\u4e8e\u6c49\u5b57\u5b57\u7b26\uff0c<code>ord()<\/code>\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u6574\u6570\u503c\uff0c\u8fd9\u4e2a\u6574\u6570\u503c\u662f\u6c49\u5b57\u5728Unicode\u5b57\u7b26\u96c6\u4e2d\u5bf9\u5e94\u7684\u7801\u70b9\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u793a\u4f8b\u4ee3\u7801<\/p>\n<p>chinese_char = &#39;\u6c49&#39;<\/p>\n<p>unicode_code_point = ord(chinese_char)<\/p>\n<p>print(f&#39;\u6c49\u5b57 &quot;{chinese_char}&quot; \u7684Unicode\u7801\u70b9\u503c\u662f\uff1a{unicode_code_point}&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>ord()<\/code>\u51fd\u6570\u5c06\u6c49\u5b57\u5b57\u7b26<code>&#39;\u6c49&#39;<\/code>\u8f6c\u6362\u4e3a\u5176\u5bf9\u5e94\u7684Unicode\u7801\u70b9\u503c<code>27721<\/code>\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c<code>ord()<\/code>\u51fd\u6570\u8fd4\u56de\u7684\u662f\u6574\u6570\u503c\uff0c\u800c\u4e0d\u662fASCII\u7801\u503c\u3002\u5982\u679c\u9700\u8981\u5c06\u5176\u8f6c\u6362\u4e3aASCII\u7801\u503c\uff0c\u53ef\u4ee5\u7ed3\u5408<code>hex()<\/code>\u51fd\u6570\u8fdb\u884c\u8f6c\u6362\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u793a\u4f8b\u4ee3\u7801<\/p>\n<p>chinese_char = &#39;\u6c49&#39;<\/p>\n<p>unicode_code_point = ord(chinese_char)<\/p>\n<p>ascii_hex = hex(unicode_code_point)<\/p>\n<p>print(f&#39;\u6c49\u5b57 &quot;{chinese_char}&quot; \u7684ASCII\u7801\u662f\uff1a{ascii_hex}&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>hex()<\/code>\u51fd\u6570\u5c06Unicode\u7801\u70b9\u503c<code>27721<\/code>\u8f6c\u6362\u4e3a\u5341\u516d\u8fdb\u5236\u8868\u793a\u5f62\u5f0f<code>0x6c49<\/code>\u3002<\/p>\n<\/p>\n<p><h2>\u4e8c\u3001\u4f7f\u7528<code>encode()<\/code>\u51fd\u6570<\/h2>\n<\/p>\n<p><p><code>encode()<\/code>\u51fd\u6570\u662fPython\u5b57\u7b26\u4e32\u5bf9\u8c61\u7684\u4e00\u4e2a\u65b9\u6cd5\uff0c\u5b83\u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u6309\u7167\u6307\u5b9a\u7684\u7f16\u7801\u683c\u5f0f\u8fdb\u884c\u7f16\u7801\u3002\u5bf9\u4e8e\u6c49\u5b57\u5b57\u7b26\uff0c\u53ef\u4ee5\u4f7f\u7528<code>encode(&#39;utf-8&#39;)<\/code>\u6216<code>encode(&#39;gbk&#39;)<\/code>\u7b49\u65b9\u6cd5\u5c06\u5176\u7f16\u7801\u4e3a\u5b57\u8282\u5e8f\u5217\uff0c\u7136\u540e\u518d\u5c06\u5b57\u8282\u5e8f\u5217\u8f6c\u6362\u4e3a\u5341\u516d\u8fdb\u5236\u8868\u793a\u5f62\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u793a\u4f8b\u4ee3\u7801<\/p>\n<p>chinese_char = &#39;\u6c49&#39;<\/p>\n<p>encoded_bytes = chinese_char.encode(&#39;utf-8&#39;)<\/p>\n<p>ascii_hex = encoded_bytes.hex()<\/p>\n<p>print(f&#39;\u6c49\u5b57 &quot;{chinese_char}&quot; \u7684UTF-8\u7f16\u7801\u7684ASCII\u7801\u662f\uff1a{ascii_hex}&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>encode(&#39;utf-8&#39;)<\/code>\u65b9\u6cd5\u5c06\u6c49\u5b57\u5b57\u7b26<code>&#39;\u6c49&#39;<\/code>\u7f16\u7801\u4e3aUTF-8\u5b57\u8282\u5e8f\u5217\uff0c\u7136\u540e<code>hex()<\/code>\u65b9\u6cd5\u5c06\u5b57\u8282\u5e8f\u5217\u8f6c\u6362\u4e3a\u5341\u516d\u8fdb\u5236\u8868\u793a\u5f62\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u793a\u4f8b\u4ee3\u7801<\/p>\n<p>chinese_char = &#39;\u6c49&#39;<\/p>\n<p>encoded_bytes = chinese_char.encode(&#39;gbk&#39;)<\/p>\n<p>ascii_hex = encoded_bytes.hex()<\/p>\n<p>print(f&#39;\u6c49\u5b57 &quot;{chinese_char}&quot; \u7684GBK\u7f16\u7801\u7684ASCII\u7801\u662f\uff1a{ascii_hex}&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>encode(&#39;gbk&#39;)<\/code>\u65b9\u6cd5\u5c06\u6c49\u5b57\u5b57\u7b26<code>&#39;\u6c49&#39;<\/code>\u7f16\u7801\u4e3aGBK\u5b57\u8282\u5e8f\u5217\uff0c\u7136\u540e<code>hex()<\/code>\u65b9\u6cd5\u5c06\u5b57\u8282\u5e8f\u5217\u8f6c\u6362\u4e3a\u5341\u516d\u8fdb\u5236\u8868\u793a\u5f62\u5f0f\u3002<\/p>\n<\/p>\n<p><h2>\u4e09\u3001\u7ed3\u5408<code>hex()<\/code>\u51fd\u6570<\/h2>\n<\/p>\n<p><p><code>hex()<\/code>\u51fd\u6570\u662fPython\u5185\u7f6e\u51fd\u6570\u4e4b\u4e00\uff0c\u5b83\u53ef\u4ee5\u5c06\u4e00\u4e2a\u6574\u6570\u8f6c\u6362\u4e3a\u5341\u516d\u8fdb\u5236\u8868\u793a\u5f62\u5f0f\u3002\u5bf9\u4e8e\u6c49\u5b57\u5b57\u7b26\uff0c\u53ef\u4ee5\u5148\u4f7f\u7528<code>ord()<\/code>\u51fd\u6570\u83b7\u53d6\u5176Unicode\u7801\u70b9\u503c\uff0c\u7136\u540e\u518d\u4f7f\u7528<code>hex()<\/code>\u51fd\u6570\u8fdb\u884c\u8f6c\u6362\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u793a\u4f8b\u4ee3\u7801<\/p>\n<p>chinese_char = &#39;\u6c49&#39;<\/p>\n<p>unicode_code_point = ord(chinese_char)<\/p>\n<p>ascii_hex = hex(unicode_code_point)<\/p>\n<p>print(f&#39;\u6c49\u5b57 &quot;{chinese_char}&quot; \u7684ASCII\u7801\u662f\uff1a{ascii_hex}&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>hex()<\/code>\u51fd\u6570\u5c06Unicode\u7801\u70b9\u503c<code>27721<\/code>\u8f6c\u6362\u4e3a\u5341\u516d\u8fdb\u5236\u8868\u793a\u5f62\u5f0f<code>0x6c49<\/code>\u3002<\/p>\n<\/p>\n<p><h2>\u56db\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93<\/h2>\n<\/p>\n<p><p>\u9664\u4e86\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\uff0c\u5982<code>unidecode<\/code>\u5e93\uff0c\u5c06\u6c49\u5b57\u5b57\u7b26\u8f6c\u6362\u4e3aASCII\u7801\u8868\u793a\u5f62\u5f0f\u3002<code>unidecode<\/code>\u5e93\u53ef\u4ee5\u5c06Unicode\u5b57\u7b26\u8f6c\u6362\u4e3aASCII\u5b57\u7b26\uff0c\u5e76\u4e14\u4fdd\u7559\u5c3d\u53ef\u80fd\u591a\u7684\u539f\u59cb\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u793a\u4f8b\u4ee3\u7801<\/p>\n<p>from unidecode import unidecode<\/p>\n<p>chinese_char = &#39;\u6c49&#39;<\/p>\n<p>ascii_char = unidecode(chinese_char)<\/p>\n<p>print(f&#39;\u6c49\u5b57 &quot;{chinese_char}&quot; \u7684ASCII\u8868\u793a\u5f62\u5f0f\u662f\uff1a{ascii_char}&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>unidecode<\/code>\u5e93\u5c06\u6c49\u5b57\u5b57\u7b26<code>&#39;\u6c49&#39;<\/code>\u8f6c\u6362\u4e3aASCII\u8868\u793a\u5f62\u5f0f<code>han<\/code>\u3002<\/p>\n<\/p>\n<p><h2>\u4e94\u3001\u7ed3\u5408\u591a\u79cd\u65b9\u6cd5<\/h2>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u53ef\u80fd\u9700\u8981\u7ed3\u5408\u591a\u79cd\u65b9\u6cd5\u6765\u5b9e\u73b0\u6c49\u5b57\u5b57\u7b26\u5230ASCII\u7801\u7684\u8f6c\u6362\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5148\u4f7f\u7528<code>ord()<\/code>\u51fd\u6570\u83b7\u53d6Unicode\u7801\u70b9\u503c\uff0c\u7136\u540e\u4f7f\u7528<code>hex()<\/code>\u51fd\u6570\u5c06\u5176\u8f6c\u6362\u4e3a\u5341\u516d\u8fdb\u5236\u8868\u793a\u5f62\u5f0f\uff0c\u6700\u540e\u4f7f\u7528<code>encode()<\/code>\u51fd\u6570\u5c06\u5176\u8f6c\u6362\u4e3a\u5b57\u8282\u5e8f\u5217\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u793a\u4f8b\u4ee3\u7801<\/p>\n<p>chinese_char = &#39;\u6c49&#39;<\/p>\n<p>unicode_code_point = ord(chinese_char)<\/p>\n<p>ascii_hex = hex(unicode_code_point)<\/p>\n<p>encoded_bytes = chinese_char.encode(&#39;utf-8&#39;)<\/p>\n<p>ascii_encoded_hex = encoded_bytes.hex()<\/p>\n<p>print(f&#39;\u6c49\u5b57 &quot;{chinese_char}&quot; \u7684Unicode\u7801\u70b9\u503c\u662f\uff1a{unicode_code_point}&#39;)<\/p>\n<p>print(f&#39;\u6c49\u5b57 &quot;{chinese_char}&quot; \u7684ASCII\u7801\u662f\uff1a{ascii_hex}&#39;)<\/p>\n<p>print(f&#39;\u6c49\u5b57 &quot;{chinese_char}&quot; \u7684UTF-8\u7f16\u7801\u7684ASCII\u7801\u662f\uff1a{ascii_encoded_hex}&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u7ed3\u5408\u4e86<code>ord()<\/code>\u51fd\u6570\u3001<code>hex()<\/code>\u51fd\u6570\u548c<code>encode()<\/code>\u51fd\u6570\u7684\u65b9\u6cd5\uff0c\u5206\u522b\u83b7\u53d6\u4e86\u6c49\u5b57\u5b57\u7b26<code>&#39;\u6c49&#39;<\/code>\u7684Unicode\u7801\u70b9\u503c\u3001\u5341\u516d\u8fdb\u5236\u8868\u793a\u5f62\u5f0f\u548cUTF-8\u7f16\u7801\u7684ASCII\u7801\u503c\u3002<\/p>\n<\/p>\n<p><h2>\u603b\u7ed3<\/h2>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u5c06\u6c49\u5b57\u5b57\u7b26\u8f6c\u6362\u4e3aASCII\u7801\uff0c\u5305\u62ec\u4f7f\u7528<code>ord()<\/code>\u51fd\u6570\u3001<code>encode()<\/code>\u51fd\u6570\u3001\u7ed3\u5408<code>hex()<\/code>\u51fd\u6570\u548c\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u7b49\u3002\u6839\u636e\u5b9e\u9645\u9700\u6c42\uff0c\u53ef\u4ee5\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u6765\u5b9e\u73b0\u8f6c\u6362\u3002\u5728\u8f6c\u6362\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u6ce8\u610f\u5b57\u7b26\u7f16\u7801\u683c\u5f0f\u7684\u9009\u62e9\u548c\u8f6c\u6362\u7ed3\u679c\u7684\u8868\u793a\u5f62\u5f0f\u3002\u901a\u8fc7\u7ed3\u5408\u591a\u79cd\u65b9\u6cd5\uff0c\u53ef\u4ee5\u66f4\u7075\u6d3b\u5730\u5904\u7406\u6c49\u5b57\u5b57\u7b26\u5230ASCII\u7801\u7684\u8f6c\u6362\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5c06\u6c49\u5b57\u8f6c\u6362\u4e3aASCII\u7801\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u6c49\u5b57\u5e76\u4e0d\u662fASCII\u5b57\u7b26\uff0c\u56e0\u6b64\u76f4\u63a5\u8f6c\u6362\u4e3aASCII\u7801\u662f\u4e0d\u53ef\u80fd\u7684\u3002ASCII\u7801\u4ec5\u5305\u542b128\u4e2a\u5b57\u7b26\uff0c\u5305\u62ec\u82f1\u6587\u5b57\u7b26\u548c\u4e00\u4e9b\u63a7\u5236\u5b57\u7b26\u3002\u5982\u679c\u9700\u8981\u5c06\u6c49\u5b57\u8f6c\u6362\u4e3a\u7c7b\u4f3cASCII\u7684\u7f16\u7801\uff0c\u901a\u5e38\u53ef\u4ee5\u4f7f\u7528UTF-8\u6216GBK\u7b49\u7f16\u7801\u683c\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7<code>encode<\/code>\u65b9\u6cd5\u8fdb\u884c\u8f6c\u6362\uff0c\u6bd4\u5982\u4f7f\u7528<code>str.encode(&#39;utf-8&#39;)<\/code>\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u4f7f\u7528\u4ec0\u4e48\u65b9\u6cd5\u53ef\u4ee5\u83b7\u53d6\u6c49\u5b57\u7684Unicode\u7f16\u7801\uff1f<\/strong><br \/>\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684<code>ord()<\/code>\u51fd\u6570\u6765\u83b7\u53d6\u6c49\u5b57\u7684Unicode\u7f16\u7801\u3002\u4f8b\u5982\uff0c<code>ord(&#39;\u6c49&#39;)<\/code>\u5c06\u8fd4\u56de\u6c49\u5b57\u201c\u6c49\u201d\u7684Unicode\u7801\u70b9\u3002Unicode\u7f16\u7801\u53ef\u4ee5\u5728\u5404\u79cd\u7f16\u7a0b\u73af\u5883\u4e2d\u88ab\u5e7f\u6cdb\u652f\u6301\uff0c\u9002\u5408\u5904\u7406\u591a\u79cd\u8bed\u8a00\u7684\u5b57\u7b26\u3002<\/p>\n<p><strong>\u5982\u4f55\u5c06\u6c49\u5b57\u8f6c\u6362\u4e3a\u5176\u5b57\u8282\u8868\u793a\u5f62\u5f0f\uff1f<\/strong><br \/>\u53ef\u4ee5\u4f7f\u7528<code>encode()<\/code>\u65b9\u6cd5\u5c06\u6c49\u5b57\u8f6c\u6362\u4e3a\u5b57\u8282\u8868\u793a\u5f62\u5f0f\u3002\u4f8b\u5982\uff0c<code>&#39;\u6c49&#39;.encode(&#39;utf-8&#39;)<\/code>\u4f1a\u8fd4\u56de\u6c49\u5b57\u201c\u6c49\u201d\u7684UTF-8\u5b57\u8282\u5e8f\u5217\u3002\u8fd9\u4e2a\u5b57\u8282\u5e8f\u5217\u53ef\u4ee5\u5b58\u50a8\u6216\u4f20\u8f93\uff0c\u800c\u5728\u9700\u8981\u65f6\u53ef\u4ee5\u4f7f\u7528<code>decode()<\/code>\u65b9\u6cd5\u5c06\u5176\u8f6c\u6362\u56de\u539f\u59cb\u6c49\u5b57\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u5c06\u6c49\u5b57\u8f6c\u6362\u4e3aASCII\u7801\u7684\u65b9\u6cd5\u6709\u51e0\u79cd\uff1a\u4f7f\u7528ord()\u51fd\u6570\u3001\u4f7f\u7528encode()\u51fd\u6570\u3001\u7ed3\u5408hex() [&hellip;]","protected":false},"author":3,"featured_media":1096743,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1096732"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1096732"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1096732\/revisions"}],"predecessor-version":[{"id":1096745,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1096732\/revisions\/1096745"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1096743"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1096732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1096732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1096732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}