{"id":4478,"date":"2019-06-18T09:08:01","date_gmt":"2019-06-18T01:08:01","guid":{"rendered":"https:\/\/ixyzero.com\/blog\/?p=4478"},"modified":"2019-06-18T09:08:01","modified_gmt":"2019-06-18T01:08:01","slug":"%e5%9c%a8python%e4%b8%ad%e5%b0%bd%e9%87%8f%e9%81%bf%e5%85%8d%e4%bd%bf%e7%94%a8sys-setdefaultencodingutf-8%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/4478.html","title":{"rendered":"\u5728Python\u4e2d\u5c3d\u91cf\u907f\u514d\u4f7f\u7528sys.setdefaultencoding(&#8216;utf-8&#8217;)\u65b9\u6cd5"},"content":{"rendered":"\n<p>=Start=<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u7f18\u7531\uff1a<\/h4>\n\n\n\n<p>\u4e4b\u524d\u5728\u5199\u4e0e\u4e2d\u6587\u5b57\u7b26\u5904\u7406\u6709\u5173\u7684Python\u4ee3\u7801\u4e2d\u603b\u559c\u6b22\u4f7f\u7528\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import sys<br>reload(sys)<br>sys.setdefaultencoding('utf-8')<\/pre>\n\n\n\n<p>\u8fd9\u79cd\u65b9\u5f0f\u6765\u907f\u514d\u7a0b\u5e8f\u51fa\u9519\u548c\u5f02\u5e38\uff0c\u4e5f\u9047\u5230\u8fc7\u4e00\u4e9b\u6587\u7ae0\u8bf4\u8fd9\u6837\u7684\u65b9\u5f0f\u4e0d\u597d\uff0c\u4f46\u4e00\u76f4\u6ca1\u6765\u5f97\u53ca\u7ec6\u770b\u8bf4\u660e\u548c\u539f\u56e0\uff0c\u8fd9\u6b21\u6709\u65f6\u95f4\u4e86\u6574\u7406\u4e00\u4e0b\uff08\u4e3b\u8981\u53c2\u8003\u7684\u662f\u300c<a href=\"https:\/\/blog.ernest.me\/post\/python-setdefaultencoding-unicode-bytes\">\u7acb\u5373\u505c\u6b62\u4f7f\u7528 setdefaultencoding(&#8216;utf-8&#8217;)\uff0c \u4ee5\u53ca\u4e3a\u4ec0\u4e48<\/a>\u300d\u4e00\u6587\uff09\uff0c\u65b9\u4fbf\u4ee5\u540e\u53c2\u8003\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u6b63\u6587\uff1a<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">\u53c2\u8003\u89e3\u7b54\uff1a<\/h5>\n\n\n\n<p class=\"has-text-color has-background has-vivid-red-color has-very-light-gray-background-color\"><strong>The use of&nbsp;<code>sys.setdefaultencoding()<\/code>&nbsp;has always been discouraged<\/strong>, and it has become a no-op in py3k. The encoding of py3k is hard-wired to &#8220;utf-8&#8221; and changing it raises an error.<\/p>\n\n\n\n<p class=\"has-background has-very-light-gray-background-color\">\u8fd9\u4e2a\u64cd\u4f5c\u6700\u5927\u7684\u95ee\u9898\u5728\u4e8e\u5b83\u5c06\u4f1a\u4f7f\u5f97\u4e00\u4e9b\u4ee3\u7801\u884c\u4e3a\u53d8\u5f97\u602a\u5f02\uff0c\u800c\u4e14\u8fd9\u602a\u5f02\u8fd8\u4e0d\u6613\u8bc6\u522b\u3001\u4e0d\u597d\u4fee\u590d\uff0c\u4ee5\u4e00\u4e2a\u4e0d\u53ef\u89c1\u7684 bug \u5b58\u5728\u7740\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h6 class=\"wp-block-heading\">1\u3001\u53ef\u80fd\u5bfc\u81f4\u7684&nbsp;dictionray \u884c\u4e3a\u5f02\u5e38<\/h6>\n\n\n\n<p>\u5047\u8bbe\u6211\u4eec\u8981\u4ece\u4e00\u4e2a&nbsp;<code>dictionary<\/code>&nbsp;\u91cc\u67e5\u627e\u4e00\u4e2a&nbsp;<code>key<\/code>&nbsp;\u662f\u5426\u5b58\u5728\uff0c\u901a\u5e38\u6765\u8bf4\uff0c\u6709\u4e24\u79cd\u53ef\u884c\u7684\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">d = {1:2, '1':'2', '\u4f60\u597d': 'hello'}<br>def key_in_dict(key):<br>    if key in d:<br>        return True<br>    return False<br><br>def key_found_in_dict(key):<br>    for _key in d:<br>        if _key == key:<br>            return True<br>    return False<\/pre>\n\n\n\n<p>\u63a5\u4e0b\u6765\u5bf9\u6bd4\u4e00\u4e0b\u6539\u53d8\u7cfb\u7edf\u9ed8\u8ba4\u7f16\u7801\u524d\u540e\u8fd9\u4fe9\u51fd\u6570\u7684\u8f93\u51fa\u6709\u4ec0\u4e48\u4e0d\u540c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">print(key_in_dict('\u4f60\u597d'))<br>print(key_in_dict(u'\u4f60\u597d'))<br>print(key_found_in_dict(u'\u4f60\u597d'))<br>'''<br>True<br>False<br>False #UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal<br>'''<br><br>print('------utf-8------')<br><br>import sys<br>reload(sys)<br>sys.setdefaultencoding('utf-8')<br><br>print(key_in_dict('\u4f60\u597d'))<br>print(key_in_dict(u'\u4f60\u597d'))<br>print(key_found_in_dict(u'\u4f60\u597d'))<br>'''<br>True<br>False<br>True<br>'''<\/pre>\n\n\n\n<p>\u53ef\u4ee5\u770b\u5230\uff0c\u5f53\u9ed8\u8ba4\u7f16\u7801\u6539\u4e86\u4e4b\u540e\uff0c\u4e24\u4e2a\u51fd\u6570\u7684\u8f93\u51fa\u4e0d\u518d\u4e00\u81f4\uff08\u5bf9\u4e8e <code>key_found_in_dict<\/code> \u51fd\u6570\u6765\u8bf4\uff09\u3002\u539f\u56e0\u5728\u4e8e\uff1a<\/p>\n\n\n\n<p><strong><code>dict<\/code>&nbsp;\u7684&nbsp;<code>in<\/code>&nbsp;\u64cd\u4f5c\u7b26\u5c06\u952e\u505a\u54c8\u5e0c\uff0c\u5e76\u6bd4\u8f83\u54c8\u5e0c\u503c\u5224\u65ad\u662f\u5426\u76f8\u7b49\u3002<\/strong><strong>\u5bf9\u4e8e ascii \u96c6\u5408\u5185\u7684\u5b57\u7b26\u6765\u8bf4\uff0c\u4e0d\u7ba1\u662f\u5b57\u8282\u5b57\u7b26\u7c7b\u578b\u8fd8\u662f\u8fd8\u662f unicode \u7c7b\u578b\uff0c\u5176\u54c8\u5e0c\u503c\u662f\u4e00\u6837\u7684<\/strong>\uff0c\u5982&nbsp;<code>u'1' in {'1':1}<\/code>&nbsp;\u4f1a\u8fd4\u56de&nbsp;<code>True<\/code>\uff0c<strong>\u800c\u8d85\u51fa ascii \u7801\u96c6\u7684\u5b57\u7b26\uff0c\u5982\u4e0a\u4f8b\u4e2d\u7684&nbsp;<code>'\u4f60\u597d'<\/code>\uff0c\u5b83\u7684\u5b57\u8282\u5b57\u7b26\u7c7b\u578b\u7684\u54c8\u5e0c\u4e0e unicode \u7c7b\u578b\u7684\u54c8\u5e0c\u662f\u4e0d\u4e00\u6837\u7684\u3002<\/strong><\/p>\n\n\n\n<p><strong>\u800c&nbsp;<code>==<\/code>&nbsp;\u64cd\u4f5c\u7b26\u5219\u662f\u505a\u4e86\u4e00\u6b21\u8f6c\u6362\uff0c\u5c06\u5b57\u8282\u5b57\u7b26\uff08byte string\uff0c\u4e0a\u9762\u7684&nbsp;<code>'\u4f60\u597d'<\/code>\uff09\u8f6c\u6362\u6210 unicode\uff08<code>u'\u4f60\u597d'<\/code>\uff09 \u7c7b\u578b\uff0c\u7136\u540e\u5bf9\u8f6c\u6362\u540e\u7684\u7ed3\u679c\u505a\u6bd4\u8f83\u3002<\/strong>\u5728 ascii \u7cfb\u7edf\u9ed8\u8ba4\u7f16\u7801\u4e2d\uff0c<code>'\u4f60\u597d'<\/code>\u8f6c\u6362\u6210 Unicode \u4f1a\u4ea7\u751f Warning:&nbsp;<code>UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal<\/code>\uff0c\u56e0\u4e3a\u8d85\u51fa\u7801\u96c6\u65e0\u6cd5\u8f6c\u6362\uff0c\u7cfb\u7edf\u4f1a\u9ed8\u8ba4\u5176\u4e0d\u76f8\u7b49\u3002<strong>\u5f53\u7cfb\u7edf\u7f16\u7801\u88ab\u6211\u4eec\u624b\u52a8\u6539\u4e3a&nbsp;<code>utf-8<\/code>&nbsp;\u540e\uff0c\u8fd9\u4e2a\u7981\u5fcc\u5219\u88ab\u89e3\u9664\uff0c<code>'\u4f60\u597d'<\/code>&nbsp;\u80fd\u591f\u987a\u5229\u88ab\u8f6c\u6362\u6210 unicode\uff0c\u6700\u540e\u7684\u7ed3\u679c\u5c31\u662f\uff0c<code>in<\/code>&nbsp;\u548c&nbsp;<code>==<\/code>&nbsp;\u884c\u4e3a\u4e0d\u518d\u4e00\u81f4\u3002<\/strong><\/p>\n\n\n\n<h6 class=\"wp-block-heading\">2\u3001\u95ee\u9898\u7684\u6839\u6e90\uff1aPython2 \u4e2d\u7684 string<\/h6>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">Python \u4e3a\u4e86\u8ba9\u5176\u8bed\u6cd5\u770b\u4e0a\u53bb\u7b80\u6d01\u597d\u7528\uff0c\u505a\u4e86\u5f88\u591a tricky \u7684\u4e8b\u60c5\uff0c\u6df7\u6dc6 byte string \u548c text string \u5c31\u662f\u5176\u4e2d\u4e00\u4f8b\u3002<\/p>\n\n\n\n<p>\u5728 Python \u91cc\uff0c\u6709\u4e09\u5927\u7c7b string \u7c7b\u578b\uff0c<code>unicode<\/code>\uff08text string\uff09\uff0c<code>str<\/code>\uff08byte string\uff0c\u4e8c\u8fdb\u5236\u6570\u636e\uff09\uff0c<code>basestring<\/code>\uff0c\u662f\u524d\u4e24\u8005\u7684\u7236\u7c7b\u3002<\/p>\n\n\n\n<p>\u5176\u5b9e\uff0c\u5728\u8bed\u8a00\u8bbe\u8ba1\u9886\u57df\uff0c\u4e00\u4e32\u5b57\u8282\uff08sequences of bytes\uff09\u662f\u5426\u5e94\u8be5\u5f53\u505a\u5b57\u7b26\u4e32\uff08string\uff09\u4e00\u76f4\u662f\u5b58\u5728\u4e89\u8bae\u7684\u3002\u6211\u4eec\u719f\u77e5\u7684 Java \u548c C# \u6295\u4e86\u53cd\u5bf9\u7968\uff0c\u800c Python \u5219\u7ad9\u5728\u4e86\u652f\u6301\u8005\u7684\u9635\u8425\u91cc\u3002\u5176\u5b9e\u6211\u4eec\u5728\u5f88\u591a\u60c5\u51b5\u4e0b\uff0c\u7ed9\u6587\u672c\u505a\u7684\u64cd\u4f5c\uff0c\u6bd4\u5982\u6b63\u5219\u5339\u914d\u3001\u5b57\u7b26\u66ff\u6362\u7b49\uff0c\u5bf9\u4e8e\u5b57\u8282\u6765\u8bf4\u662f\u7528\u4e0d\u7740\u7684\u3002\u800c Python \u8ba4\u4e3a\u5b57\u8282\u5c31\u662f\u5b57\u7b26\uff0c\u6240\u4ee5\u4ed6\u4eec\u4fe9\u7684\u64cd\u4f5c\u96c6\u5408\u662f\u4e00\u81f4\u7684\u3002<\/p>\n\n\n\n<p>\u7136\u540e\u8fdb\u4e00\u6b65\u7684\uff0c<strong>Python \u4f1a\u5728\u5fc5\u8981\u7684\u60c5\u51b5\u4e0b\uff0c\u5c1d\u8bd5\u5bf9\u5b57\u8282\u505a\u81ea\u52a8\u7c7b\u578b\u8f6c\u6362\uff0c\u4f8b\u5982\uff0c\u5728\u4e0a\u6587\u4e2d\u7684&nbsp;<code>==<\/code>\uff0c\u6216\u8005\u5b57\u8282\u548c\u6587\u672c\u62fc\u63a5\u65f6\u3002\u5982\u679c\u6ca1\u6709\u4e00\u4e2a\u7f16\u7801\uff08encoding\uff09\uff0c\u4e24\u4e2a\u4e0d\u540c\u7c7b\u578b\u4e4b\u95f4\u7684\u8f6c\u6362\u662f\u65e0\u6cd5\u8fdb\u884c\u7684\uff0c\u4e8e\u662f\uff0cPython \u9700\u8981\u4e00\u4e2a\u9ed8\u8ba4\u7f16\u7801\u3002<\/strong>\u5728 Python2 \u8bde\u751f\u7684\u5e74\u4ee3\uff0cASCII \u662f\u6700\u6d41\u884c\u7684\uff08\u53ef\u4ee5\u8fd9\u4e48\u8bf4\u5427\uff09\uff0c\u4e8e\u662f Python2 \u9009\u62e9\u4e86 ASCII\u3002<strong>\u7136\u800c\uff0c\u4f17\u6240\u5468\u77e5\uff0c\u5728\u9700\u8981\u9700\u8981\u8f6c\u6362\u7684\u573a\u666f\uff0cASCII \u90fd\u662f\u6ca1\u7528\u7684\uff08128\u4e2a\u5b57\u7b26\uff0c\u591f\u4ec0\u4e48\u5403\uff09\u3002<\/strong><br><\/p>\n\n\n\n<p>\u5728\u5386\u7ecf\u8fd9\u4e48\u591a\u5e74\u5410\u69fd\u540e\uff0cPython 3 \u7ec8\u4e8e\u5b66\u4e56\u4e86\u3002\u9ed8\u8ba4\u7f16\u7801\u662f Unicode\uff0c\u8fd9\u4e5f\u5c31\u610f\u5473\u7740\uff0c\u505a\u6240\u6709\u9700\u8981\u8f6c\u6362\u7684\u573a\u5408\uff0c\u90fd\u80fd\u6b63\u786e\u5e76\u6210\u529f\u7684\u8f6c\u6362\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">3\u3001\u5e94\u5bf9\u6b64\u7c7b\u95ee\u9898\u7684\u6700\u4f73\u5b9e\u8df5<\/h6>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>\u65b9\u6cd5\u4e00\uff1a\u76f4\u63a5\u4f7f\u7528\/\u8fc1\u79fb\u81f3 Python 3 \u3002<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>Python 3\u6700\u91cd\u8981\u7684\u65b0\u7279\u6027\u5927\u6982\u8981\u7b97\u662f\u5bf9\u6587\u672c\u548c\u4e8c\u8fdb\u5236\u6570\u636e\u4f5c\u4e86\u66f4\u4e3a\u6e05\u6670\u7684\u533a\u5206\u3002\u6587\u672c\u603b\u662fUnicode\uff0c\u7531str\u7c7b\u578b\u8868\u793a\uff0c\u4e8c\u8fdb\u5236\u6570\u636e\u5219\u7531bytes\u7c7b\u578b\u8868\u793a\u3002Python 3\u4e0d\u4f1a\u4ee5\u4efb\u610f\u9690\u5f0f\u7684\u65b9\u5f0f\u6df7\u7528str\u548cbytes\uff0c\u6b63\u662f\u8fd9\u4f7f\u5f97\u4e24\u8005\u7684\u533a\u5206\u7279\u522b\u6e05\u6670\u3002<\/strong>\u4f60\u4e0d\u80fd\u62fc\u63a5\u5b57\u7b26\u4e32\u548c\u5b57\u8282\u5305\uff0c\u4e5f\u65e0\u6cd5\u5728\u5b57\u8282\u5305\u91cc\u641c\u7d22\u5b57\u7b26\u4e32\uff08\u53cd\u4e4b\u4ea6\u7136\uff09\uff0c\u4e5f\u4e0d\u80fd\u5c06\u5b57\u7b26\u4e32\u4f20\u5165\u53c2\u6570\u4e3a\u5b57\u8282\u5305\u7684\u51fd\u6570\uff08\u53cd\u4e4b\u4ea6\u7136\uff09\u3002\u8fd9\u662f\u4ef6\u597d\u4e8b\u3002<\/p>\n\n\n\n<p><strong>\u5b57\u7b26\u4e32\u53ef\u4ee5\u7f16\u7801encode()\u6210\u5b57\u8282\u5305<\/strong>\uff0c\u800c<strong>\u5b57\u8282\u5305\u53ef\u4ee5\u89e3\u7801decode()\u6210\u5b57\u7b26\u4e32<\/strong>\u3002<\/p>\n\n\n\n<p>\u65b9\u6cd5\u4e8c\uff08\u5728\u7ee7\u7eed\u4f7f\u7528Python 2\u65f6\u7684\u51e0\u4e2a\u5efa\u8bae\uff09\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>\u6240\u6709 text string \u90fd\u5e94\u8be5\u662f unicode \u7c7b\u578b\uff0c\u800c\u4e0d\u662f str<\/strong>\uff0c\u5982\u679c\u4f60\u5728\u64cd\u4f5c text\uff0c\u800c\u7c7b\u578b\u5374\u662f str\uff0c\u90a3\u5c31\u662f\u5728\u5236\u9020 bug\u3002<\/li><li><strong>\u5728\u9700\u8981\u8f6c\u6362\u7684\u65f6\u5019\uff0c\u663e\u5f0f\u8f6c\u6362\u3002<\/strong>\u4ece\u5b57\u8282\u89e3\u7801\u6210\u6587\u672c\uff0c\u7528&nbsp;<code>var.decode(encoding)<\/code>\uff0c\u4ece\u6587\u672c\u7f16\u7801\u6210\u5b57\u8282\uff0c\u7528&nbsp;<code>var.encode(encoding)<\/code>\u3002<\/li><li><strong>\u4ece\u5916\u90e8\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u9ed8\u8ba4\u5b83\u662f\u5b57\u8282\uff0c\u7136\u540e&nbsp;<code>decode<\/code>&nbsp;\u6210\u9700\u8981\u7684\u6587\u672c\uff1b\u540c\u6837\u7684\uff0c\u5f53\u9700\u8981\u5411\u5916\u90e8\u53d1\u9001\u6587\u672c\u65f6\uff0c<code>encode<\/code>&nbsp;\u6210\u5b57\u8282\u518d\u53d1\u9001\u3002<\/strong><\/li><\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">\u53c2\u8003\u94fe\u63a5\uff1a<\/h5>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><em>\u7acb\u5373\u505c\u6b62\u4f7f\u7528 setdefaultencoding(&#8216;utf-8&#8217;)\uff0c \u4ee5\u53ca\u4e3a\u4ec0\u4e48<\/em><\/strong><br><a href=\"https:\/\/blog.ernest.me\/post\/python-setdefaultencoding-unicode-bytes\">https:\/\/blog.ernest.me\/post\/python-setdefaultencoding-unicode-bytes<\/a><\/li><li>UTF-8 codes<br><a href=\"http:\/\/www.utf8-chartable.de\/\">http:\/\/www.utf8-chartable.de\/<\/a><\/li><li>LATIN-1 codes<br><a href=\"http:\/\/www.unicodetools.com\/unicode\/codepage-latin.php\">http:\/\/www.unicodetools.com\/unicode\/codepage-latin.php<\/a><\/li><li>ASCII wiki<br><a href=\"https:\/\/en.wikipedia.org\/wiki\/ASCII\">https:\/\/en.wikipedia.org\/wiki\/ASCII<\/a><\/li><li>Why sys.setdefaultencoding() will break code<br><a href=\"https:\/\/anonbadger.wordpress.com\/2015\/06\/16\/why-sys-setdefaultencoding-will-break-code\/\">https:\/\/anonbadger.wordpress.com\/2015\/06\/16\/why-sys-setdefaultencoding-will-break-code\/<\/a><\/li><li><strong>Getting unicode right in Python<\/strong><br><a href=\"http:\/\/blog.notdot.net\/2010\/07\/Getting-unicode-right-in-Python\">http:\/\/blog.notdot.net\/2010\/07\/Getting-unicode-right-in-Python<\/a><\/li><li><a href=\"https:\/\/stackoverflow.com\/questions\/3828723\/why-should-we-not-use-sys-setdefaultencodingutf-8-in-a-py-script\">https:\/\/stackoverflow.com\/questions\/3828723\/why-should-we-not-use-sys-setdefaultencodingutf-8-in-a-py-script<\/a><\/li><li><a href=\"http:\/\/blog.ianbicking.org\/illusive-setdefaultencoding.html\">http:\/\/blog.ianbicking.org\/illusive-setdefaultencoding.html<\/a><\/li><li><a href=\"http:\/\/nedbatchelder.com\/blog\/200401\/printing_unicode_from_python.html\">http:\/\/nedbatchelder.com\/blog\/200401\/printing_unicode_from_python.html<\/a><\/li><li><a href=\"http:\/\/www.diveintopython3.net\/strings.html#one-ring-to-rule-them-all\">http:\/\/www.diveintopython3.net\/strings.html#one-ring-to-rule-them-all<\/a><\/li><li><a href=\"http:\/\/boodebr.org\/main\/python\/all-about-python-and-unicode\">http:\/\/boodebr.org\/main\/python\/all-about-python-and-unicode<\/a><\/li><\/ul>\n\n\n\n<p>=END=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>=Start= \u7f18\u7531\uff1a \u4e4b\u524d\u5728\u5199\u4e0e\u4e2d\u6587\u5b57\u7b26\u5904\u7406\u6709\u5173\u7684Python\u4ee3\u7801\u4e2d\u603b\u559c\u6b22\u4f7f\u7528\uff1a import sysrel [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,7],"tags":[1424,1426,1425,8,558,217],"class_list":["post-4478","post","type-post","status-publish","format-standard","hentry","category-knowledgebase-2","category-programing","tag-bytes","tag-decode","tag-encode","tag-python","tag-string","tag-unicode"],"views":5264,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/4478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=4478"}],"version-history":[{"count":2,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/4478\/revisions"}],"predecessor-version":[{"id":4495,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/4478\/revisions\/4495"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=4478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=4478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=4478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}