{"id":1021745,"date":"2024-12-27T13:26:35","date_gmt":"2024-12-27T05:26:35","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1021745.html"},"modified":"2024-12-27T13:26:37","modified_gmt":"2024-12-27T05:26:37","slug":"%e4%bd%bf%e7%94%a8python%e5%a6%82%e4%bd%95%e7%bc%96%e7%a0%81unicode","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1021745.html","title":{"rendered":"\u4f7f\u7528python\u5982\u4f55\u7f16\u7801unicode"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25164059\/fc9c1111-d3bf-4ce6-8039-13eead09418a.webp\" alt=\"\u4f7f\u7528python\u5982\u4f55\u7f16\u7801unicode\" \/><\/p>\n<p><p> \u4f7f\u7528Python\u8fdb\u884cUnicode\u7f16\u7801\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\u3002<strong>\u4f7f\u7528\u5185\u7f6e\u7684<code>str.encode()<\/code>\u65b9\u6cd5\u3001<code>bytes.decode()<\/code>\u65b9\u6cd5\u3001\u4ee5\u53ca<code>codecs<\/code>\u6a21\u5757\u8fdb\u884c\u5904\u7406<\/strong>\u3002\u5176\u4e2d\uff0c<code>str.encode()<\/code>\u65b9\u6cd5\u662f\u6700\u5e38\u7528\u7684\u65b9\u5f0f\u4e4b\u4e00\uff0c\u5b83\u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6307\u5b9a\u7f16\u7801\u683c\u5f0f\u7684\u5b57\u8282\u5bf9\u8c61\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Python\u4e2d\u5904\u7406Unicode\u7f16\u7801\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e9b\u793a\u4f8b\u4ee3\u7801\u6765\u5e2e\u52a9\u7406\u89e3\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001PYTHON\u4e2d\u7684UNICODE\u57fa\u7840<\/h3>\n<\/p>\n<p><p>Python\u4e2d\u7684\u5b57\u7b26\u4e32\u9ed8\u8ba4\u662fUnicode\u5b57\u7b26\u4e32\uff0c\u8fd9\u610f\u5473\u7740\u5b83\u4eec\u53ef\u4ee5\u5305\u542b\u5404\u79cd\u8bed\u8a00\u7684\u5b57\u7b26\u3002Unicode\u662f\u4e00\u79cd\u5b57\u7b26\u7f16\u7801\u6807\u51c6\uff0c\u65e8\u5728\u652f\u6301\u5168\u7403\u6240\u6709\u8bed\u8a00\u7684\u5b57\u7b26\u3002Python 3.x\u7248\u672c\u4e2d\uff0c\u9ed8\u8ba4\u7684\u5b57\u7b26\u4e32\u7c7b\u578b\u662fUnicode\u7c7b\u578b\uff0c\u8fd9\u4f7f\u5f97\u5904\u7406\u56fd\u9645\u5316\u5b57\u7b26\u53d8\u5f97\u66f4\u5bb9\u6613\u3002<\/p>\n<\/p>\n<p><h4>1. Unicode\u5b57\u7b26\u4e0e\u7f16\u7801<\/h4>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0cUnicode\u5b57\u7b26\u53ef\u4ee5\u901a\u8fc7\u5176\u7801\u70b9\uff08code point\uff09\u8fdb\u884c\u8868\u793a\u3002\u7801\u70b9\u662f\u4e00\u4e2a\u552f\u4e00\u7684\u6570\u5b57\u6807\u8bc6\u7b26\uff0c\u7528\u4e8e\u6807\u8bc6\u7279\u5b9a\u7684\u5b57\u7b26\u3002\u5e38\u89c1\u7684Unicode\u7f16\u7801\u5305\u62ecUTF-8\u3001UTF-16\u548cUTF-32\u3002UTF-8\u662f\u4e00\u79cd\u53d8\u957f\u7f16\u7801\uff0c\u6bcf\u4e2a\u5b57\u7b26\u4f7f\u75281\u52304\u4e2a\u5b57\u8282\u6765\u8868\u793a\uff0c\u5e7f\u6cdb\u7528\u4e8e\u7f51\u7edc\u548c\u6587\u4ef6\u5b58\u50a8\u3002<\/p>\n<\/p>\n<p><h4>2. \u5b57\u7b26\u4e32\u7f16\u7801\u4e0e\u89e3\u7801<\/h4>\n<\/p>\n<p><p>\u5b57\u7b26\u4e32\u7f16\u7801\u662f\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5b57\u8282\u5bf9\u8c61\u7684\u8fc7\u7a0b\uff0c\u901a\u5e38\u7528\u4e8e\u6570\u636e\u5b58\u50a8\u548c\u4f20\u8f93\u3002\u89e3\u7801\u5219\u662f\u5c06\u5b57\u8282\u5bf9\u8c61\u8f6c\u6362\u56de\u5b57\u7b26\u4e32\u7684\u8fc7\u7a0b\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>encode()<\/code>\u65b9\u6cd5\u8fdb\u884c\u7f16\u7801\uff0c<code>decode()<\/code>\u65b9\u6cd5\u8fdb\u884c\u89e3\u7801\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528<code>str.encode()<\/code>\u65b9\u6cd5\u8fdb\u884cUNICODE\u7f16\u7801<\/h3>\n<\/p>\n<p><p><code>str.encode()<\/code>\u65b9\u6cd5\u7528\u4e8e\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5b57\u8282\u5bf9\u8c61\u3002\u53ef\u4ee5\u6307\u5b9a\u7f16\u7801\u683c\u5f0f\uff0c\u5982UTF-8\u3001UTF-16\u7b49\u3002<\/p>\n<\/p>\n<p><h4>1. \u57fa\u672c\u7528\u6cd5<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5b9a\u4e49\u4e00\u4e2aUnicode\u5b57\u7b26\u4e32<\/p>\n<p>unicode_str = &quot;\u4f60\u597d\uff0c\u4e16\u754c&quot;<\/p>\n<h2><strong>\u4f7f\u7528UTF-8\u7f16\u7801<\/strong><\/h2>\n<p>utf8_encoded = unicode_str.encode(&#39;utf-8&#39;)<\/p>\n<p>print(utf8_encoded)  # \u8f93\u51fa\uff1ab&#39;\\xe4\\xbd\\xa0\\xe5\\xa5\\xbd\\xef\\xbc\\x8c\\xe4\\xb8\\x96\\xe7\\x95\\x8c&#39;<\/p>\n<h2><strong>\u4f7f\u7528UTF-16\u7f16\u7801<\/strong><\/h2>\n<p>utf16_encoded = unicode_str.encode(&#39;utf-16&#39;)<\/p>\n<p>print(utf16_encoded)  # \u8f93\u51fa\uff1ab&#39;\\xff\\xfe`O}Y\\x0c\\xff]h&#39;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u9519\u8bef\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u5728\u7f16\u7801\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u65e0\u6cd5\u7f16\u7801\u7684\u5b57\u7b26\u3002\u8fd9\u65f6\u53ef\u4ee5\u6307\u5b9a\u9519\u8bef\u5904\u7406\u7b56\u7565\uff0c\u5982<code>&#39;ignore&#39;<\/code>\u5ffd\u7565\u9519\u8bef\u3001<code>&#39;replace&#39;<\/code>\u4f7f\u7528\u66ff\u4ee3\u5b57\u7b26\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528\u66ff\u4ee3\u5b57\u7b26\u5904\u7406\u7f16\u7801\u9519\u8bef<\/p>\n<p>invalid_unicode_str = &quot;hello \\udc00 world&quot;<\/p>\n<p>utf8_encoded = invalid_unicode_str.encode(&#39;utf-8&#39;, errors=&#39;replace&#39;)<\/p>\n<p>print(utf8_encoded)  # \u8f93\u51fa\uff1ab&#39;hello ? world&#39;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528<code>bytes.decode()<\/code>\u65b9\u6cd5\u8fdb\u884cUNICODE\u89e3\u7801<\/h3>\n<\/p>\n<p><p>\u89e3\u7801\u662f\u5c06\u5b57\u8282\u5bf9\u8c61\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u7684\u8fc7\u7a0b\u3002<code>bytes.decode()<\/code>\u65b9\u6cd5\u7528\u4e8e\u6b64\u76ee\u7684\u3002<\/p>\n<\/p>\n<p><h4>1. \u57fa\u672c\u7528\u6cd5<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5df2\u7f16\u7801\u7684UTF-8\u5b57\u8282\u5bf9\u8c61<\/p>\n<p>utf8_encoded = b&#39;\\xe4\\xbd\\xa0\\xe5\\xa5\\xbd\\xef\\xbc\\x8c\\xe4\\xb8\\x96\\xe7\\x95\\x8c&#39;<\/p>\n<h2><strong>\u89e3\u7801\u4e3aUnicode\u5b57\u7b26\u4e32<\/strong><\/h2>\n<p>unicode_str = utf8_encoded.decode(&#39;utf-8&#39;)<\/p>\n<p>print(unicode_str)  # \u8f93\u51fa\uff1a\u4f60\u597d\uff0c\u4e16\u754c<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u9519\u8bef\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u89e3\u7801\u8fc7\u7a0b\u4e2d\u4e5f\u53ef\u80fd\u9047\u5230\u65e0\u6cd5\u89e3\u7801\u7684\u5b57\u8282\uff0c\u53ef\u4ee5\u6307\u5b9a\u9519\u8bef\u5904\u7406\u7b56\u7565\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528\u5ffd\u7565\u9519\u8bef\u7684\u7b56\u7565\u8fdb\u884c\u89e3\u7801<\/p>\n<p>invalid_utf8_bytes = b&#39;\\xe4\\xbd\\xa0\\xe5\\xa5\\xbd\\xef\\xbc\\x8c\\xe4\\xb8\\x96\\xe7&#39;<\/p>\n<p>decoded_str = invalid_utf8_bytes.decode(&#39;utf-8&#39;, errors=&#39;ignore&#39;)<\/p>\n<p>print(decoded_str)  # \u8f93\u51fa\uff1a\u4f60\u597d\uff0c<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528<code>codecs<\/code>\u6a21\u5757\u8fdb\u884c\u7f16\u7801\u4e0e\u89e3\u7801<\/h3>\n<\/p>\n<p><p><code>codecs<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u66f4\u5e95\u5c42\u7684\u7f16\u7801\u548c\u89e3\u7801\u63a5\u53e3\uff0c\u53ef\u4ee5\u7528\u4e8e\u66f4\u590d\u6742\u7684\u7f16\u7801\u65b9\u6848\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528<code>codecs<\/code>\u8fdb\u884c\u7f16\u7801<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import codecs<\/p>\n<h2><strong>\u5b9a\u4e49Unicode\u5b57\u7b26\u4e32<\/strong><\/h2>\n<p>unicode_str = &quot;\u4f60\u597d\uff0c\u4e16\u754c&quot;<\/p>\n<h2><strong>\u4f7f\u7528codecs\u6a21\u5757\u8fdb\u884cUTF-8\u7f16\u7801<\/strong><\/h2>\n<p>utf8_encoded = codecs.encode(unicode_str, &#39;utf-8&#39;)<\/p>\n<p>print(utf8_encoded)  # \u8f93\u51fa\uff1ab&#39;\\xe4\\xbd\\xa0\\xe5\\xa5\\xbd\\xef\\xbc\\x8c\\xe4\\xb8\\x96\\xe7\\x95\\x8c&#39;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u4f7f\u7528<code>codecs<\/code>\u8fdb\u884c\u89e3\u7801<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import codecs<\/p>\n<h2><strong>\u5df2\u7f16\u7801\u7684UTF-8\u5b57\u8282\u5bf9\u8c61<\/strong><\/h2>\n<p>utf8_encoded = b&#39;\\xe4\\xbd\\xa0\\xe5\\xa5\\xbd\\xef\\xbc\\x8c\\xe4\\xb8\\x96\\xe7\\x95\\x8c&#39;<\/p>\n<h2><strong>\u4f7f\u7528codecs\u6a21\u5757\u8fdb\u884cUTF-8\u89e3\u7801<\/strong><\/h2>\n<p>unicode_str = codecs.decode(utf8_encoded, &#39;utf-8&#39;)<\/p>\n<p>print(unicode_str)  # \u8f93\u51fa\uff1a\u4f60\u597d\uff0c\u4e16\u754c<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u5904\u7406\u6587\u4ef6\u4e2d\u7684UNICODE\u7f16\u7801<\/h3>\n<\/p>\n<p><p>\u5728\u5904\u7406\u6587\u4ef6\u65f6\uff0c\u6b63\u786e\u7684\u7f16\u7801\u548c\u89e3\u7801\u5bf9\u4e8e\u8bfb\u53d6\u548c\u5199\u5165\u6587\u4ef6\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<\/p>\n<p><h4>1. \u8bfb\u53d6\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528<code>open()<\/code>\u51fd\u6570\u7684<code>encoding<\/code>\u53c2\u6570\u53ef\u4ee5\u6307\u5b9a\u6587\u4ef6\u7684\u7f16\u7801\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8bfb\u53d6UTF-8\u7f16\u7801\u7684\u6587\u4ef6<\/p>\n<p>with open(&#39;example.txt&#39;, &#39;r&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>    content = file.read()<\/p>\n<p>    print(content)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u5199\u5165\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>\u540c\u6837\uff0c\u53ef\u4ee5\u5728\u5199\u5165\u6587\u4ef6\u65f6\u6307\u5b9a\u7f16\u7801\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5199\u5165UTF-8\u7f16\u7801\u7684\u6587\u4ef6<\/p>\n<p>with open(&#39;example_output.txt&#39;, &#39;w&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>    file.write(&quot;\u4f60\u597d\uff0c\u4e16\u754c&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3\u4e0e\u6700\u4f73\u5b9e\u8df5<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\u5904\u7406Unicode\u7f16\u7801\u662f\u4e00\u4e2a\u57fa\u7840\u4f46\u91cd\u8981\u7684\u6280\u80fd\uff0c\u5c24\u5176\u5728\u5f00\u53d1\u56fd\u9645\u5316\u5e94\u7528\u65f6\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6700\u4f73\u5b9e\u8df5\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u59cb\u7ec8\u6307\u5b9a\u7f16\u7801<\/strong>\uff1a\u65e0\u8bba\u662f\u7f16\u7801\u5b57\u7b26\u4e32\u8fd8\u662f\u8bfb\u5199\u6587\u4ef6\uff0c\u59cb\u7ec8\u660e\u786e\u6307\u5b9a\u7f16\u7801\u683c\u5f0f\uff0c\u4ee5\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u9519\u8bef\u3002<\/li>\n<li><strong>\u5904\u7406\u7f16\u7801\u9519\u8bef<\/strong>\uff1a\u4f7f\u7528\u9519\u8bef\u5904\u7406\u7b56\u7565\u6765\u5e94\u5bf9\u53ef\u80fd\u51fa\u73b0\u7684\u7f16\u7801\u9519\u8bef\uff0c\u5982<code>ignore<\/code>\u6216<code>replace<\/code>\u3002<\/li>\n<li><strong>\u4f7f\u7528\u5408\u9002\u7684\u6a21\u5757<\/strong>\uff1a\u5bf9\u4e8e\u7b80\u5355\u7684\u7f16\u7801\u4efb\u52a1\uff0c<code>str.encode()<\/code>\u548c<code>bytes.decode()<\/code>\u5df2\u7ecf\u8db3\u591f\uff1b\u5bf9\u4e8e\u590d\u6742\u7684\u9700\u6c42\uff0c<code>codecs<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u66f4\u5f3a\u5927\u7684\u529f\u80fd\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u7406\u89e3\u548c\u5e94\u7528\u8fd9\u4e9b\u77e5\u8bc6\uff0c\u53ef\u4ee5\u5728Python\u4e2d\u6709\u6548\u5730\u8fdb\u884cUnicode\u7f16\u7801\u548c\u89e3\u7801\uff0c\u786e\u4fdd\u7a0b\u5e8f\u7684\u591a\u8bed\u8a00\u652f\u6301\u548c\u6570\u636e\u5904\u7406\u7684\u6b63\u786e\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u67e5\u770bUnicode\u5b57\u7b26\u7684\u7f16\u7801\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684<code>ord()<\/code>\u51fd\u6570\u6765\u67e5\u770b\u5b57\u7b26\u7684Unicode\u7f16\u7801\u3002\u4f8b\u5982\uff0c<code>ord(&#39;A&#39;)<\/code>\u5c06\u8fd4\u56de65\uff0c\u8fd9\u662f\u5b57\u7b26&#39;A&#39;\u7684Unicode\u7f16\u7801\u3002\u5bf9\u4e8e\u66f4\u590d\u6742\u7684\u5b57\u7b26\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f20\u5165\u5b57\u7b26\u4ee5\u83b7\u53d6\u5176\u5bf9\u5e94\u7684\u7f16\u7801\u3002<\/p>\n<p><strong>Python\u4e2d\u5982\u4f55\u5c06Unicode\u7f16\u7801\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\uff1f<\/strong><br \/>\u8981\u5c06Unicode\u7f16\u7801\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\uff0c\u53ef\u4ee5\u4f7f\u7528<code>chr()<\/code>\u51fd\u6570\u3002\u53ea\u9700\u4f20\u5165Unicode\u7f16\u7801\u503c\uff0c\u4f8b\u5982\uff0c<code>chr(65)<\/code>\u5c06\u8fd4\u56de&#39;A&#39;\u3002\u8fd9\u4f7f\u5f97\u5728\u5904\u7406Unicode\u6570\u636e\u65f6\uff0c\u7f16\u7801\u548c\u89e3\u7801\u8fc7\u7a0b\u53d8\u5f97\u7b80\u5355\u800c\u76f4\u89c2\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u5904\u7406Unicode\u5b57\u7b26\u4e32\u7684\u7f16\u7801\u95ee\u9898\uff1f<\/strong><br \/>\u5904\u7406Unicode\u5b57\u7b26\u4e32\u65f6\uff0c\u4f7f\u7528<code>encode()<\/code>\u548c<code>decode()<\/code>\u65b9\u6cd5\u975e\u5e38\u91cd\u8981\u3002\u5bf9\u4e8ePython 3\uff0c\u5b57\u7b26\u4e32\u9ed8\u8ba4\u662fUnicode\uff0c\u56e0\u6b64\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528<code>str.encode(&#39;utf-8&#39;)<\/code>\u6765\u5c06Unicode\u5b57\u7b26\u4e32\u7f16\u7801\u4e3a\u5b57\u8282\u4e32\u3002\u76f8\u53cd\uff0c\u4f7f\u7528<code>bytes.decode(&#39;utf-8&#39;)<\/code>\u53ef\u4ee5\u5c06\u5b57\u8282\u4e32\u8f6c\u6362\u56deUnicode\u5b57\u7b26\u4e32\u3002\u786e\u4fdd\u5728\u5904\u7406\u4e0d\u540c\u5b57\u7b26\u96c6\u65f6\uff0c\u6b63\u786e\u6307\u5b9a\u7f16\u7801\u7c7b\u578b\uff0c\u4ee5\u907f\u514d\u4e71\u7801\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u8fdb\u884cUnicode\u7f16\u7801\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\u3002\u4f7f\u7528\u5185\u7f6e\u7684str.encode()\u65b9\u6cd5\u3001bytes [&hellip;]","protected":false},"author":3,"featured_media":1021752,"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\/1021745"}],"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=1021745"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1021745\/revisions"}],"predecessor-version":[{"id":1021755,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1021745\/revisions\/1021755"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1021752"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1021745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1021745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1021745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}