{"version":"1.0","published":"2016-07-02 10:47:32","author_name":"nekoyukimmm","categories":["Python","flask"],"description":"python3\u306e\u5834\u5408\u3001\u6587\u5b57\u5217\u306f\u3001\u3046\u306b\u3053\u30fc\u3069unicode\u306e\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u3092\u4e26\u3079\u305f\u3082\u306e \u3068\u306e\u3053\u3068\u3002 \u3088\u3046\u306f\u3001UTF-8\u306e\u3053\u3068\u3089\u3057\u3044\u3002 python2\u3068\u306f\u9055\u3046\u306e\u3067\u6ce8\u610f\uff01\u3002 python2\u306e\u4f8b\u3092\u53c2\u8003\u3059\u308b\u3068\u306f\u307e\u308b\u3002 \u30d5\u30a1\u30a4\u30eb\u3068\u304b\u306b\u66f8\u304d\u3060\u3059\u3068\u3044\u3046\u3053\u3068\u306f\u3001\u6587\u5b57\u5217\u3092\u30a8\u30f3\u30b3\u30fc\u30c9\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u3002 \u305d\u306e\uff11 \u6587\u5b57\u5217str\u304b\u3089\u3001\u5404\u6587\u5b57\u30b3\u30fc\u30c9\u306e\u30d0\u30a4\u30c8\u5217bytes\u306b\u3059\u308bencode\u306b\u306f\u4e0b\u8a18\u3002 In [1]: '\u3042' Out[1]: '\u3042' In [2]: s = '\u3042' In [3]: type(s) Out[3]: str In [4]: s.encode('utf-8') Out[4]: b'\\xe3\\x81\\x82\u2026","author_url":"https://blog.hatena.ne.jp/nekoyukimmm/","provider_url":"https://hatena.blog","provider_name":"Hatena Blog","width":"100%","url":"https://nekoyukimmm.hatenablog.com/entry/2016/07/02/104732","blog_url":"https://nekoyukimmm.hatenablog.com/","image_url":null,"title":"<Python> \u6587\u5b57\u30b3\u30fc\u30c9\u306e\u3081\u3082","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnekoyukimmm.hatenablog.com%2Fentry%2F2016%2F07%2F02%2F104732\" title=\"&lt;Python&gt; \u6587\u5b57\u30b3\u30fc\u30c9\u306e\u3081\u3082 - \u306d\u3053\u3086\u304d\u306e\u30e1\u30e2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"\u306d\u3053\u3086\u304d\u306e\u30e1\u30e2","height":"190","type":"rich"}