{"id":140,"date":"2023-11-27T07:25:57","date_gmt":"2022-08-11T18:50:06","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95\/"},"modified":"2025-07-31T21:05:13","modified_gmt":"2025-07-31T12:05:13","slug":"python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95\/","title":{"rendered":"Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5"},"content":{"rendered":"<p>\u8457\u8005\u306f\u300cWrite for Donations\u300d\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001\u5bc4\u4ed8\u3092\u53d7\u3051\u308b\u305f\u3081\u306b\u30d5\u30ea\u30fc\u3067\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u57fa\u91d1\u3092\u9078\u629e\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3>\u30a4\u30f3\u30c8\u30ed\u30c0\u30af\u30b7\u30e7\u30f3<\/h3>\n<p>Unicode\u306f\u3001\u4e16\u754c\u306e\u307b\u3068\u3093\u3069\u306e\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u306b\u304a\u3051\u308b\u6a19\u6e96\u7684\u306a\u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u3059\u3002\u305d\u308c\u306f\u3001\u6587\u5b57\u3084\u8a18\u53f7\u3001\u7d75\u6587\u5b57\u3001\u5236\u5fa1\u6587\u5b57\u3092\u542b\u3080\u30c6\u30ad\u30b9\u30c8\u304c\u7570\u306a\u308b\u30c7\u30d0\u30a4\u30b9\u3001\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3001\u30c7\u30b8\u30bf\u30eb\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u4e0a\u3067\u3082\u30aa\u30da\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u3084\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306b\u95a2\u4fc2\u306a\u304f\u540c\u3058\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u3092\u4fdd\u8a3c\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u3084\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u696d\u754c\u306b\u304a\u3044\u3066\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u3066\u304a\u308a\u3001\u305d\u308c\u304c\u306a\u3051\u308c\u3070\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u306f\u6df7\u6c8c\u3068\u3057\u305f\u3082\u306e\u306b\u306a\u308a\u3001\u4f7f\u7528\u304c\u56f0\u96e3\u3068\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>Unicode\u81ea\u4f53\u306f\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u5730\u7403\u4e0a\u306e\u307b\u307c\u3059\u3079\u3066\u306e\u6587\u5b57\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002Unicode\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u5404\u6587\u5b57\u306b\u5bfe\u3059\u308b\u8b58\u5225\u5b50\u3067\u3042\u308b\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u3092\u542b\u3093\u3067\u304a\u308a\u3001\u305d\u306e\u5024\u306f0\u304b\u3089110\u4e07\u307e\u3067\u306e\u7bc4\u56f2\u3092\u6301\u3061\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u3053\u308c\u3089\u306e\u30e6\u30cb\u30fc\u30af\u306a\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u304c\u3059\u3050\u306b\u67af\u6e07\u3059\u308b\u3053\u3068\u306f\u975e\u5e38\u306b\u3042\u308a\u305d\u3046\u3082\u3042\u308a\u307e\u305b\u3093\u3002Unicode\u306e\u3059\u3079\u3066\u306e\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u306fU+n\u3068\u3044\u3046\u5f62\u3067\u8868\u3055\u308c\u307e\u3059\u3002\u3053\u3053\u3067\u3001U+\u306fUnicode\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u3001n\u306f\u6587\u5b57\u306e\u305f\u3081\u306e4\u304b\u30896\u6841\u306e16\u9032\u6570\u306e\u96c6\u5408\u3067\u3059\u3002ASCII\u3068\u6bd4\u3079\u3066\u3001Unicode\u306f\u3088\u308a\u5805\u7262\u306a\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u3067\u3059\u3002ASCII\u306f128\u6587\u5b57\u3057\u304b\u8868\u73fe\u3067\u304d\u307e\u305b\u3093\u304c\u3001Unicode\u306f\u307b\u307c15\u4e07\u306e\u6587\u5b57\u3092\u6301\u3061\u3001\u5730\u7403\u4e0a\u306e\u3059\u3079\u3066\u306e\u8a00\u8a9e\u306e\u6587\u5b57\u3092\u30ab\u30d0\u30fc\u3057\u3066\u3044\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001ASCII\u3067\u30c7\u30b8\u30bf\u30eb\u30c6\u30ad\u30b9\u30c8\u3092\u4e16\u754c\u4e2d\u3067\u4ea4\u63db\u3059\u308b\u3053\u3068\u306f\u56f0\u96e3\u3067\u3057\u305f\u304c\u3001Unicode\u306a\u3089\u30a2\u30af\u30bb\u30f3\u30c8\u306e\u4ed8\u3044\u305f\u6587\u5b57\u3082\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306b\u306f\u3001Python\u306a\u3069\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u304c\u30c6\u30ad\u30b9\u30c8\u3092\u9069\u5207\u306b\u6271\u3044\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c\u56fd\u969b\u5316\u3092\u5b9f\u73fe\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002Python\u306f\u3001\u96fb\u5b50\u30e1\u30fc\u30eb\u304b\u3089\u30b5\u30fc\u30d0\u30fc\u3001\u30a6\u30a7\u30d6\u307e\u3067\u5e45\u5e83\u3044\u7528\u9014\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001Unicode\u3092\u512a\u96c5\u306b\u6271\u3046\u65b9\u6cd5\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001Python\u304c\u6587\u5b57\u5217\u306b\u5bfe\u3057\u3066Unicode\u6a19\u6e96\u3092\u63a1\u7528\u3059\u308b\u3053\u3068\u3067\u5b9f\u73fe\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Python\u3067Unicode\u3092\u6271\u3046\u3053\u3068\u306f\u3001\u6df7\u4e71\u3092\u751f\u307f\u3001\u30a8\u30e9\u30fc\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Unicode\u3092Python\u3067\u4f7f\u7528\u3059\u308b\u57fa\u672c\u3092\u63d0\u4f9b\u3057\u3001\u3053\u308c\u3089\u306e\u554f\u984c\u3092\u56de\u907f\u3059\u308b\u305f\u3081\u306e\u624b\u52a9\u3051\u3092\u3057\u307e\u3059\u3002Python\u3092\u4f7f\u7528\u3057\u3066Unicode\u3092\u89e3\u91c8\u3057\u3001Python\u306e\u6b63\u898f\u5316\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u3092\u6b63\u898f\u5316\u3057\u3001Python\u306eUnicode\u30a8\u30e9\u30fc\u3092\u51e6\u7406\u3057\u307e\u3059\u3002<\/p>\n<h2>\u524d\u63d0\u6761\u4ef6<\/h2>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u5f93\u3046\u305f\u3081\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3082\u306e\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>Python installed locally or on a remote server. If you do not already have Python set up, you can do so by following our tutorial How To Install Python 3 and Set Up a Programming Environment. Choose the version that is appropriate for your Linux distribution.<\/li>\n<li>Familiarity with basic Python programming and Python\u2019s string methods<\/li>\n<li>Knowledge of how to work with the Python Interactive Console<\/li>\n<\/ul>\n<h2>\u30b9\u30c6\u30c3\u30d71 &#8211; Python\u3067Unicode\u306e\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u3092\u5909\u63db\u3059\u308b<\/h2>\n<p>\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3068\u306f\u3001\u30c7\u30fc\u30bf\u3092\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u304c\u8aad\u307f\u53d6\u308c\u308b\u5f62\u5f0f\u3067\u8868\u73fe\u3059\u308b\u30d7\u30ed\u30bb\u30b9\u306e\u3053\u3068\u3067\u3059\u3002ASCII\u3084Latin-1\u306a\u3069\u3001\u30c7\u30fc\u30bf\u3092\u30a8\u30f3\u30b3\u30fc\u30c9\u3059\u308b\u305f\u3081\u306e\u3055\u307e\u3056\u307e\u306a\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u304a\u305d\u3089\u304f\u6700\u3082\u4e00\u822c\u7684\u306a\u306e\u306fUTF-8\u3067\u3057\u3087\u3046\u3002UTF-8\u306f\u3001\u4e16\u754c\u4e2d\u306e\u6587\u5b57\u30921\u3064\u306e\u6587\u5b57\u30bb\u30c3\u30c8\u3067\u8868\u73fe\u3067\u304d\u308b\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u4e00\u7a2e\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u56fd\u969b\u5316\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u6271\u3046\u4eba\u306b\u3068\u3063\u3066\u306f\u3001\u6b20\u304b\u305b\u306a\u3044\u30c4\u30fc\u30eb\u3067\u3059\u3002\u4e00\u822c\u7684\u306b\u306f\u3001\u307b\u3068\u3093\u3069\u306e\u7528\u9014\u306b\u304a\u3044\u3066UTF-8\u306f\u826f\u3044\u9078\u629e\u3067\u3059\u3002\u6bd4\u8f03\u7684\u52b9\u7387\u7684\u3067\u3001\u3055\u307e\u3056\u307e\u306a\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3068\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002UTF-8\u306fUnicode\u306e\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u309216\u9032\u6570\u306e\u30d0\u30a4\u30c8\u306b\u5909\u63db\u3057\u3001\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u304c\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u3064\u307e\u308a\u3001Unicode\u304c\u30de\u30c3\u30d4\u30f3\u30b0\u3067\u3042\u308a\u3001UTF-8\u304c\u305d\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u3092\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u304c\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u4ed5\u7d44\u307f\u3067\u3059\u3002<\/p>\n<p>Python 3\u3067\u306f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6587\u5b57\u5217\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306fUTF-8\u3067\u3042\u308a\u3001\u3064\u307e\u308aPython\u306e\u6587\u5b57\u5217\u5185\u306e\u4efb\u610f\u306eUnicode\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u306f\u81ea\u52d5\u7684\u306b\u5bfe\u5fdc\u3059\u308b\u6587\u5b57\u306b\u5909\u63db\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u624b\u9806\u3067\u306f\u3001Python\u3067Unicode\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u3066\u8457\u4f5c\u6a29\u8a18\u53f7\uff08\u00a9\uff09\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u307e\u305a\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3067Python\u306e\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u8d77\u52d5\u3057\u3001\u6b21\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> s <span class=\"token operator\">=<\/span>  <span class=\"token string\">'\\u00A9'<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> s\r\n<\/code><\/pre>\n<p>\u524d\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001Unicode\u306e\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\\u00A9\u3092\u6301\u3064\u6587\u5b57\u5217s\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u524d\u8ff0\u306e\u901a\u308a\u3001Python\u306e\u6587\u5b57\u5217\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067UTF-8\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u305f\u3081\u3001s\u306e\u5024\u3092\u8868\u793a\u3059\u308b\u3068\u81ea\u52d5\u7684\u306b\u5bfe\u5fdc\u3059\u308bUnicode\u306e\u8a18\u53f7\u306b\u5909\u63db\u3055\u308c\u307e\u3059\u3002\u306a\u304a\u3001\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u306e\u524d\u306b\u3042\u308b\\u\u306f\u5fc5\u8981\u3067\u3059\u3002\u3053\u308c\u304c\u306a\u3044\u3068\u3001Python\u306f\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u3092\u5909\u63db\u3067\u304d\u307e\u305b\u3093\u3002\u524d\u306e\u30b3\u30fc\u30c9\u306e\u51fa\u529b\u306f\u5bfe\u5fdc\u3059\u308bUnicode\u306e\u8a18\u53f7\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&#8216;\u00a9&#8217;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Python\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306b\u306f\u3001\u6587\u5b57\u5217\u3092\u30a8\u30f3\u30b3\u30fc\u30c9\u304a\u3088\u3073\u30c7\u30b3\u30fc\u30c9\u3059\u308b\u305f\u3081\u306e\u7d44\u307f\u8fbc\u307f\u95a2\u6570\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002encode() \u95a2\u6570\u306f\u3001\u6587\u5b57\u5217\u3092\u30d0\u30a4\u30c8\u6587\u5b57\u5217\u306b\u5909\u63db\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u8a3c\u660e\u3059\u308b\u305f\u3081\u306b\u3001Python\u306e\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u958b\u304d\u3001\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token string\">'\ud83c\udd65'<\/span><span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span><span class=\"token string\">'utf-8'<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u306f\u3001\u6587\u5b57\u306e\u30d0\u30a4\u30c8\u6587\u5b57\u5217\u3092\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>b&#8217;\\xf0\\x9f\\x85\\xa5&#8242;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5404\u30d0\u30a4\u30c8\u306e\u524d\u306b\u300c\\x\u300d\u304c\u4ed8\u3044\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u305d\u308c\u304c16\u9032\u6570\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>\u6ce8\u610f\uff1aWindows\u3068Mac\u3067\u306f\u3001\u7279\u5225\u306aUnicode\u6587\u5b57\u3092\u5165\u529b\u3059\u308b\u65b9\u6cd5\u304c\u7570\u306a\u308a\u307e\u3059\u3002\u5148\u306b\u793a\u3057\u305f\u30b3\u30fc\u30c9\u304a\u3088\u3073\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u4f7f\u7528\u3055\u308c\u308b\u30b7\u30f3\u30dc\u30eb\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001Windows\u306e\u6587\u5b57\u30de\u30c3\u30d7\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u4f7f\u7528\u3057\u3066\u30b7\u30f3\u30dc\u30eb\u3092\u633f\u5165\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002Mac\u306b\u306f\u3053\u306e\u6a5f\u80fd\u304c\u5b58\u5728\u3057\u306a\u3044\u305f\u3081\u3001\u6700\u5584\u306e\u65b9\u6cd5\u306f\u30b3\u30fc\u30c9\u4f8b\u304b\u3089\u6587\u5b57\u3092\u30b3\u30d4\u30fc\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/div>\n<\/div>\n<p>\u6b21\u306b\u3001decode()\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u30d0\u30a4\u30c8\u6587\u5b57\u5217\u3092\u6587\u5b57\u5217\u306b\u5909\u63db\u3057\u307e\u3059\u3002decode()\u95a2\u6570\u306f\u3001\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30bf\u30a4\u30d7\u3092\u5f15\u6570\u3068\u3057\u3066\u53d7\u3051\u5165\u308c\u307e\u3059\u3002\u307e\u305f\u3001decode()\u95a2\u6570\u306f\u3001\u6587\u5b57\u5217\u306e\u5148\u982d\u306bb\u3092\u4f7f\u7528\u3057\u3066\u6307\u5b9a\u3055\u308c\u305f\u30d0\u30a4\u30c8\u6587\u5b57\u5217\u306e\u307f\u3092\u30c7\u30b3\u30fc\u30c9\u3067\u304d\u308b\u3053\u3068\u3092\u8a00\u53ca\u3059\u308b\u4fa1\u5024\u304c\u3042\u308a\u307e\u3059\u3002b\u3092\u524a\u9664\u3059\u308b\u3068\u3001AttributeError\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044:<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token string\">b'\\xf0\\x9f\\x85\\xa5'<\/span><span class=\"token punctuation\">.<\/span>decode<span class=\"token punctuation\">(<\/span><span class=\"token string\">'utf-8'<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u30b3\u30fc\u30c9\u306f\u3053\u306e\u3088\u3046\u306a\u51fa\u529b\u3092\u8fd4\u3057\u307e\u3059\u3002 (K\u014ddo wa kono y\u014dna shutsuryoku o kaeshimasu.)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&#8216;\ud83c\udd65&#8217;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3042\u306a\u305f\u306f\u73fe\u5728\u3001Python\u306b\u304a\u3051\u308bUnicode\u306e\u89e3\u91c8\u306b\u3064\u3044\u3066\u57fa\u672c\u7684\u306a\u7406\u89e3\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u6b21\u306b\u3001Python\u306e\u7d44\u307f\u8fbc\u307f\u306eunicodedata\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u3001\u6587\u5b57\u5217\u306b\u5bfe\u3057\u3066\u9ad8\u5ea6\u306aUnicode\u6280\u8853\u3092\u5b9f\u884c\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d72- Python\u306b\u304a\u3051\u308bUnicode\u306e\u6b63\u898f\u5316<\/h2>\n<p>\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001Python\u3067Unicode\u3092\u6b63\u898f\u5316\u3057\u307e\u3059\u3002\u6b63\u898f\u5316\u306b\u3088\u308a\u3001\u7570\u306a\u308b\u30d5\u30a9\u30f3\u30c8\u3067\u66f8\u304b\u308c\u305f2\u3064\u306e\u6587\u5b57\u304c\u540c\u3058\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u7570\u306a\u308b\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u3092\u6301\u30642\u3064\u306e\u6587\u5b57\u304c\u540c\u3058\u7d50\u679c\u3092\u751f\u3080\u5834\u5408\u306b\u4fbf\u5229\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001Unicode\u306e\u6587\u5b57R\u3068\u211c\u306f\u3001\u4eba\u306e\u76ee\u306b\u306f\u540c\u3058\u3067\u3042\u308a\u3001\u3069\u3061\u3089\u3082R\u306e\u6587\u5b57\u3067\u3059\u304c\u3001\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u306f\u305d\u308c\u3089\u3092\u7570\u306a\u308b\u6587\u5b57\u3068\u307f\u306a\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u4f8b\u306f\u3053\u308c\u3092\u66f4\u306b\u5b9f\u8a3c\u3057\u307e\u3059\u3002Python\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u958b\u304d\u3001\u4ee5\u4e0b\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> styled_R <span class=\"token operator\">=<\/span> <span class=\"token string\">'\u211c'<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> normal_R <span class=\"token operator\">=<\/span> <span class=\"token string\">'R'<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> styled_R <span class=\"token operator\">==<\/span> normal_R\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u7d50\u679c\u3092\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002 (Shimashou)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>False<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306f\u3001Python\u306e\u6587\u5b57\u5217\u306f2\u3064\u306e\u6587\u5b57\u3092\u540c\u4e00\u3068\u898b\u306a\u3055\u306a\u3044\u305f\u3081\u3001\u51fa\u529b\u306fFalse\u3068\u306a\u308a\u307e\u3059\u3002Unicode\u3092\u6271\u3046\u969b\u306b\u6b63\u898f\u5316\u304c\u91cd\u8981\u306a\u7406\u7531\u306f\u3001\u3053\u306e\u3088\u3046\u306a\u533a\u5225\u304c\u3067\u304d\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>Unicode\u3067\u306f\u3001\u3044\u304f\u3064\u304b\u306e\u6587\u5b57\u306f2\u3064\u4ee5\u4e0a\u306e\u6587\u5b57\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u4f5c\u3089\u308c\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u6b63\u898f\u5316\u306f\u91cd\u8981\u3067\u3059\u3002\u6b63\u898f\u5316\u306b\u3088\u308a\u3001\u6587\u5b57\u5217\u304c\u4e92\u3044\u306b\u4e00\u8cab\u6027\u3092\u6301\u3064\u3053\u3068\u304c\u4fdd\u305f\u308c\u307e\u3059\u3002\u3053\u306e\u6982\u5ff5\u3092\u3088\u308a\u826f\u304f\u7406\u89e3\u3059\u308b\u305f\u3081\u306b\u3001Python\u306e\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u958b\u3044\u3066\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> s1 <span class=\"token operator\">=<\/span>  <span class=\"token string\">'h\u00f4tel'<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> s2 <span class=\"token operator\">=<\/span> <span class=\"token string\">'ho\\u0302tel'<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>s1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>s2<span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u524d\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u6587\u5b57\u5217s1\u306b\u300c\u00f4\u300d\u306e\u6587\u5b57\u3092\u542b\u3080\u3088\u3046\u306b\u4f5c\u6210\u3057\u30012\u884c\u76ee\u3067\u306f\u6587\u5b57\u5217s2\u306b\u306f\u30b5\u30fc\u30ab\u30e0\u30d5\u30ec\u30c3\u30af\u30b9\u6587\u5b57\uff08\u0302 \uff09\u306e\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u5b9f\u884c\u5f8c\u3001\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u51fa\u529b\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>(5, 6)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5148\u884c\u3059\u308b\u51fa\u529b\u306f\u30012\u3064\u306e\u6587\u5b57\u5217\u304c\u540c\u3058\u6587\u5b57\u3067\u69cb\u6210\u3055\u308c\u3066\u3044\u308b\u304c\u3001\u9577\u3055\u304c\u7570\u306a\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u304a\u308a\u3001\u305d\u306e\u305f\u3081\u7b49\u4fa1\u6027\u306e\u30c6\u30b9\u30c8\u306b\u306f\u5931\u6557\u3059\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002\u540c\u3058\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u4ee5\u4e0b\u3092\u5165\u529b\u3057\u3066\u30c6\u30b9\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> s1 <span class=\"token operator\">==<\/span> s2\r\n<\/code><\/pre>\n<p>\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u51fa\u529b\u3092\u8fd4\u3057\u307e\u3059\u3002 (The code returns the following output.)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>False<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6587\u5b57\u5217\u5909\u6570s1\u3068s2\u306f\u540c\u3058Unicode\u6587\u5b57\u3092\u751f\u6210\u3059\u308b\u3082\u306e\u306e\u3001\u9577\u3055\u304c\u7570\u306a\u308b\u305f\u3081\u306b\u7b49\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001normalize\uff08\uff09\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u3053\u306e\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d73 \u2014 NFD\u3001NFC\u3001NFKD\u3001\u304a\u3088\u3073NFKC\u3068\u3044\u3046\u65b9\u6cd5\u3067Unicode\u3092\u6b63\u898f\u5316\u3059\u308b<\/h2>\n<p>\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001Python\u306eunicodedata\u30e9\u30a4\u30d6\u30e9\u30ea\u306eunicodedata\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3001\u6587\u5b57\u306e\u691c\u7d22\u3068\u6b63\u898f\u5316\u6a5f\u80fd\u3092\u63d0\u4f9b\u3059\u308bnormalize()\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u3001Unicode\u6587\u5b57\u5217\u3092\u6a19\u6e96\u5316\u3057\u307e\u3059\u3002normalize()\u95a2\u6570\u306f\u3001\u6700\u521d\u306e\u5f15\u6570\u3068\u3057\u3066\u6b63\u898f\u5316\u5f62\u5f0f\u30012\u756a\u76ee\u306e\u5f15\u6570\u3068\u3057\u3066\u6b63\u898f\u5316\u3055\u308c\u308b\u6587\u5b57\u5217\u3092\u53d6\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002Unicode\u306b\u306f\u3001NFD\u3001NFC\u3001NFKD\u3001NFKC\u306e4\u3064\u306e\u6b63\u898f\u5316\u5f62\u5f0f\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>NFD\u6b63\u898f\u5316\u5f62\u5f0f\u306f\u3001\u6587\u5b57\u3092\u8907\u6570\u306e\u7d50\u5408\u6587\u5b57\u306b\u5206\u89e3\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u3063\u3066\u30c6\u30ad\u30b9\u30c8\u304c\u30a2\u30af\u30bb\u30f3\u30c8\u306b\u5bfe\u3057\u3066\u7121\u611f\u5fdc\u306b\u306a\u308a\u3001\u691c\u7d22\u3084\u30bd\u30fc\u30c8\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u3053\u308c\u3092\u884c\u3046\u306b\u306f\u3001\u6587\u5b57\u5217\u3092\u30d0\u30a4\u30c8\u306b\u30a8\u30f3\u30b3\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u958b\u3044\u3066\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token keyword\">from<\/span> unicodedata <span class=\"token keyword\">import<\/span> normalize\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> s1 <span class=\"token operator\">=<\/span>  <span class=\"token string\">'h\u00f4tel'<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> s2 <span class=\"token operator\">=<\/span> <span class=\"token string\">'ho\\u0302tel'<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> s1_nfd <span class=\"token operator\">=<\/span> normalize<span class=\"token punctuation\">(<\/span><span class=\"token string\">'NFD'<\/span><span class=\"token punctuation\">,<\/span> s1<span class=\"token punctuation\">)<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>s1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>s1_nfd<span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u30b3\u30fc\u30c9\u3067\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>(5, 6)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u4f8b\u304c\u793a\u3059\u901a\u308a\u3001\u6587\u5b57\u5217s1\u3092\u6b63\u898f\u5316\u3059\u308b\u3068\u3001\u305d\u306e\u9577\u3055\u306f1\u6587\u5b57\u5897\u3048\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u00f4\u30b7\u30f3\u30dc\u30eb\u304c2\u3064\u306e\u6587\u5b57\uff08o\u3068\u02c6\uff09\u306b\u5206\u5272\u3055\u308c\u308b\u305f\u3081\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> s1<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> s1_nfd<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u7d50\u679c\u306e\u51fa\u529b\u306f\u3001\u6b63\u898f\u5316\u3055\u308c\u305f\u6587\u5b57\u5217\u3092\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u305f\u5f8c\u3001\u6587\u5b57\u5217s1_nfd\u306b\u304a\u3044\u3066o\u306e\u6587\u5b57\u304c\u02c6\u306e\u6587\u5b57\u304b\u3089\u5206\u96e2\u3055\u308c\u305f\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>(b&#8217;h\\xc3\\xb4tel&#8217;, b&#8217;ho\\xcc\\x82tel&#8217;)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>NFC\u6b63\u898f\u5316\u5f62\u5f0f\u306f\u3001\u307e\u305a\u6587\u5b57\u3092\u5206\u89e3\u3057\u3001\u305d\u308c\u304b\u3089\u4f7f\u7528\u53ef\u80fd\u306a\u7d50\u5408\u6587\u5b57\u3067\u518d\u69cb\u6210\u3057\u307e\u3059\u3002NFC\u306f\u3001\u6700\u3082\u77ed\u3044\u51fa\u529b\u3092\u751f\u6210\u3059\u308b\u3088\u3046\u306b\u6587\u5b57\u5217\u3092\u7d44\u307f\u7acb\u3066\u308b\u305f\u3081\u3001W3C\u306f\u30a6\u30a7\u30d6\u3067NFC\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u63a8\u5968\u3057\u3066\u3044\u307e\u3059\u3002\u30ad\u30fc\u30dc\u30fc\u30c9\u306e\u5165\u529b\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u7d50\u5408\u6587\u5b57\u3092\u8fd4\u3059\u305f\u3081\u3001\u305d\u306e\u5834\u5408\u306b\u306fNFC\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u826f\u3044\u30a2\u30a4\u30c7\u30a2\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3068\u3057\u3066\u3001\u6b21\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306a\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token keyword\">from<\/span> unicodedata <span class=\"token keyword\">import<\/span> normalize\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> s2_nfc <span class=\"token operator\">=<\/span> normalize<span class=\"token punctuation\">(<\/span><span class=\"token string\">'NFC'<\/span><span class=\"token punctuation\">,<\/span> s2<span class=\"token punctuation\">)<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>s2<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>s2_nfc<span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u51fa\u529b\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>(6, 5)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4f8b\u3048\u3070\u3001\u6587\u5b57\u5217s2\u3092\u6b63\u898f\u5316\u3059\u308b\u3053\u3068\u3067\u9577\u3055\u304c1\u6e1b\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u30b3\u30f3\u30bd\u30fc\u30eb\u3067\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u305d\u308c\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> s2<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> s2_nfc<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u30b3\u30fc\u30c9\u306e\u51fa\u529b\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>(b&#8217;ho\\xcc\\x82tel&#8217;, b&#8217;h\\xc3\\xb4tel&#8217;)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u51fa\u529b\u7d50\u679c\u306f\u3001o\u3068\u02c6\u306e\u6587\u5b57\u304c\uff11\u3064\u306e\u00f4\u6587\u5b57\u306b\u7d71\u5408\u3055\u308c\u305f\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>NFKD\u304a\u3088\u3073NFKC\u6b63\u898f\u5316\u5f62\u5f0f\u306f\u3001\u300c\u53b3\u5bc6\u306a\u300d\u6b63\u898f\u5316\u306b\u4f7f\u7528\u3055\u308c\u3001Unicode\u6587\u5b57\u5217\u306e\u691c\u7d22\u3084\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3068\u95a2\u9023\u3059\u308b\u3055\u307e\u3056\u307e\u306a\u554f\u984c\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002NFKD\u304a\u3088\u3073NFKC\u306e\u300cK\u300d\u306f\u4e92\u63db\u6027\u3092\u8868\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>NFD\u304a\u3088\u3073NFC\u306e\u6b63\u898f\u5316\u5f62\u5f0f\u306f\u3001\u6587\u5b57\u3092\u5206\u89e3\u3057\u307e\u3059\u304c\u3001NFKD\u304a\u3088\u3073NFKC\u306f\u4f3c\u3066\u3044\u306a\u3044\u304c\u540c\u7b49\u306e\u6587\u5b57\u306b\u5bfe\u3057\u3066\u4e92\u63db\u6027\u5206\u89e3\u3092\u5b9f\u884c\u3057\u3001\u4efb\u610f\u306e\u66f8\u5f0f\u306e\u9055\u3044\u3092\u53d6\u308a\u9664\u304d\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u6587\u5b57\u5217\u300c\u2461\u2460\u300d\u306f\u300c21\u300d\u3068\u4f3c\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u4e21\u65b9\u3068\u3082\u540c\u3058\u5024\u3092\u8868\u3057\u3066\u3044\u307e\u3059\u3002NFKC\u304a\u3088\u3073NFKD\u306e\u6b63\u898f\u5316\u5f62\u5f0f\u306f\u3001\u3053\u308c\u3089\u306e\u6587\u5b57\u304b\u3089\u66f8\u5f0f\uff08\u3053\u306e\u5834\u5408\u306f\u6570\u5b57\u306e\u5468\u308a\u306e\u5186\uff09\u3092\u53d6\u308a\u9664\u3044\u3066\u3001\u6700\u3082\u30b7\u30f3\u30d7\u30eb\u306a\u5f62\u5f0f\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u4f8b\u306f\u3001NFD\u3068NFKD\u306e\u6b63\u898f\u5316\u306e\u5f62\u5f0f\u306e\u9055\u3044\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002Python\u306e\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u958b\u3044\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> s1 <span class=\"token operator\">=<\/span> <span class=\"token string\">'2\u2075\u00f4'<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token keyword\">from<\/span> unicodedata <span class=\"token keyword\">import<\/span> normalize\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> normalize<span class=\"token punctuation\">(<\/span><span class=\"token string\">'NFD'<\/span><span class=\"token punctuation\">,<\/span> s1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> normalize<span class=\"token punctuation\">(<\/span><span class=\"token string\">'NFKD'<\/span><span class=\"token punctuation\">,<\/span> s1<span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u7d50\u679c\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#8216;2\u2075o\u0302&#8217;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#8217;25o\u0302&#8217;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u51fa\u529b\u7d50\u679c\u304b\u3089\u5206\u304b\u308b\u3088\u3046\u306b\u3001\u6587\u5b57\u5217s1\u5185\u306e\u6307\u6570\u6587\u5b57\u306fNFD\u5f62\u5f0f\u3067\u306f\u5206\u89e3\u3067\u304d\u307e\u305b\u3093\u304c\u3001NFKD\u5f62\u5f0f\u3067\u306f\u6307\u6570\u306e\u66f8\u5f0f\u304c\u53d6\u308a\u9664\u304b\u308c\u3001\u4e92\u63db\u6027\u6587\u5b57\uff08\u3053\u306e\u5834\u5408\u306f\u6307\u6570\u306e5\uff09\u304c\u305d\u308c\u306b\u76f8\u5f53\u3059\u308b\u6570\u5024\uff085\u3068\u3044\u3046\u6570\u5b57\uff09\u306b\u7f6e\u304d\u63db\u3048\u3089\u308c\u307e\u3057\u305f\u3002NFD\u3068NFKD\u306e\u6b63\u898f\u5316\u5f62\u5f0f\u306f\u307e\u3060\u6587\u5b57\u3092\u5206\u89e3\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u5148\u307b\u3069\u306eNFD\u306e\u4f8b\u3067\u898b\u305f\u3088\u3046\u306b\u3001&#8221;\u00f4&#8221;\u306e\u6587\u5b57\u306f\u9577\u3055\u304c1\u5897\u3048\u308b\u306f\u305a\u3067\u3059\u3002\u3053\u308c\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>normalize<span class=\"token punctuation\">(<\/span><span class=\"token string\">'NFD'<\/span><span class=\"token punctuation\">,<\/span> s1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>normalize<span class=\"token punctuation\">(<\/span><span class=\"token string\">'NFKD'<\/span><span class=\"token punctuation\">,<\/span> s1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u7d50\u679c\u304c\u30b3\u30fc\u30c9\u304b\u3089\u8fd4\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>(4, 4)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>NFKC\u6b63\u898f\u5316\u5f62\u5f0f\u306f\u4f3c\u305f\u3088\u3046\u306a\u65b9\u6cd5\u3067\u52d5\u4f5c\u3057\u307e\u3059\u304c\u3001\u6587\u5b57\u3092\u5206\u89e3\u3059\u308b\u4ee3\u308f\u308a\u306b\u7d44\u307f\u7acb\u3066\u307e\u3059\u3002\u540c\u3058Python\u30b3\u30f3\u30bd\u30fc\u30eb\u3067\u6b21\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> normalize<span class=\"token punctuation\">(<\/span><span class=\"token string\">'NFC'<\/span><span class=\"token punctuation\">,<\/span> s1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> normalize<span class=\"token punctuation\">(<\/span><span class=\"token string\">'NFKC'<\/span><span class=\"token punctuation\">,<\/span> s1<span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>(&#8216;2\u2075\u00f4&#8217;, &#8217;25\u00f4&#8217;)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>NFKC\u306f\u5408\u6210\u30a2\u30d7\u30ed\u30fc\u30c1\u306b\u5f93\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u5206\u89e3\u306e\u5834\u5408\u306b\u306f\u6587\u5b57\u5217\u304c1\u6587\u5b57\u77ed\u304f\u306a\u308b\u3053\u3068\u3092\u671f\u5f85\u3059\u308b\u3079\u304d\u3067\u3059\u3002\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u3053\u308c\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>normalize<span class=\"token punctuation\">(<\/span><span class=\"token string\">'NFC'<\/span><span class=\"token punctuation\">,<\/span> s1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>normalize<span class=\"token punctuation\">(<\/span><span class=\"token string\">'NFKC'<\/span><span class=\"token punctuation\">,<\/span> s1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u6b21\u306e\u51fa\u529b\u304c\u8fd4\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>(3, 3)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u524d\u306e\u624b\u9806\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u6b63\u898f\u5316\u306e\u7a2e\u985e\u3068\u305d\u306e\u9055\u3044\u306b\u3064\u3044\u3066\u306e\u4f5c\u696d\u77e5\u8b58\u304c\u5f97\u3089\u308c\u307e\u3059\u3002\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001Python\u3067\u306eUnicode\u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d74\u2212Python\u3067Unicode\u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3059\u308b<\/h2>\n<p>Python\u3067Unicode\u3092\u51e6\u7406\u3059\u308b\u969b\u306b\u306f\u3001UnicodeEncodeError\u3068UnicodeDecodeError\u306e2\u7a2e\u985e\u306eUnicode\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306eUnicode\u30a8\u30e9\u30fc\u306f\u6df7\u4e71\u3092\u5f15\u304d\u8d77\u3053\u3059\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u7ba1\u7406\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u3053\u306e\u6bb5\u968e\u3067\u4e21\u65b9\u306e\u30a8\u30e9\u30fc\u3092\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n<h3>UnicodeEncodeError\u306e\u89e3\u6c7a<\/h3>\n<p>Unicode\u3067\u306e\u30a8\u30f3\u30b3\u30fc\u30c9\u306f\u3001\u7279\u5b9a\u306e\u30a8\u30f3\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066Unicode\u6587\u5b57\u5217\u3092\u30d0\u30a4\u30c8\u306b\u5909\u63db\u3059\u308b\u30d7\u30ed\u30bb\u30b9\u3067\u3059\u3002UnicodeEncodeError\u306f\u3001\u6307\u5b9a\u3055\u308c\u305f\u30a8\u30f3\u30b3\u30fc\u30c9\u3067\u306f\u8868\u73fe\u3067\u304d\u306a\u3044\u6587\u5b57\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u6587\u5b57\u5217\u3092\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u3088\u3046\u3068\u3057\u305f\u6642\u306b\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<p>ASCII\u6587\u5b57\u96c6\u5408\u306b\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u6587\u5b57\u3092\u542b\u3080\u6587\u5b57\u5217\u3092\u30a8\u30f3\u30b3\u30fc\u30c9\u3059\u308b\u3053\u3068\u3067\u3001\u3053\u306e\u30a8\u30e9\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u958b\u304d\u3001\u6b21\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>(Kons\u014dru o hiraki, tsugi no y\u014d ni ny\u016bryoku shite kudasai.)<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> ascii_supported <span class=\"token operator\">=<\/span> <span class=\"token string\">'\\u0041'<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> ascii_supported<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span><span class=\"token string\">'ascii'<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306f\u3042\u306a\u305f\u306e\u51fa\u529b\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>b&#8217;A&#8217;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u305d\u308c\u304b\u3089\u3001\u4ee5\u4e0b\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044:<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> ascii_unsupported <span class=\"token operator\">=<\/span> <span class=\"token string\">'\\ufb06'<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> ascii_unsupported<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span><span class=\"token string\">'utf-8'<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>b&#8217;\\xef\\xac\\x86&#8242;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6700\u7d42\u7684\u306b\u3001\u4ee5\u4e0b\u3092\u30bf\u30a4\u30d7\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> ascii_unsupported<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span><span class=\"token string\">'ascii'<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u6b21\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Traceback (most recent call last): File &#8220;&lt;stdin&gt;&#8221;, line 1, in &lt;module&gt; UnicodeEncodeError: &#8216;ascii&#8217; codec can&#8217;t encode character &#8216;\\ufb06&#8217; in position 0: ordinal not in range(128)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>ASCII\u306b\u306f\u9650\u3089\u308c\u305f\u6570\u306e\u6587\u5b57\u3057\u304b\u5b58\u5728\u305b\u305a\u3001ASCII\u6587\u5b57\u96c6\u5408\u306b\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u6587\u5b57\u304cPython\u3067\u898b\u3064\u304b\u308b\u3068\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002ASCII\u6587\u5b57\u96c6\u5408\u306f\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\\ufb06\u3092\u8a8d\u8b58\u3057\u306a\u3044\u305f\u3081\u3001Python\u306f128\u3057\u304b\u306a\u3044\u3068\u3044\u3046\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8fd4\u3057\u3001\u3053\u306e\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u306e\u5341\u9032\u6570\u306e\u76f8\u5f53\u5024\u304c\u305d\u306e\u7bc4\u56f2\u5185\u306b\u306a\u3044\u3053\u3068\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>encode()\u95a2\u6570\u306eerrors\u5f15\u6570\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001UnicodeEncodeError\u3092\u51e6\u7406\u3067\u304d\u307e\u3059\u3002errors\u5f15\u6570\u306b\u306f\u3001ignore\u3001replace\u3001xmlcharrefreplace\u306e3\u3064\u306e\u5024\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u958b\u3044\u3066\u3001\u4ee5\u4e0b\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> ascii_unsupported <span class=\"token operator\">=<\/span> <span class=\"token string\">'\\ufb06'<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> ascii_unsupported<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span><span class=\"token string\">'ascii'<\/span><span class=\"token punctuation\">,<\/span> errors<span class=\"token operator\">=<\/span><span class=\"token string\">'ignore'<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u7d50\u679c\u304c\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>b&#8221;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306b\u4ee5\u4e0b\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> ascii_unsupported<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span><span class=\"token string\">'ascii'<\/span><span class=\"token punctuation\">,<\/span> errors<span class=\"token operator\">=<\/span><span class=\"token string\">'replace'<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u51fa\u529b\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>b&#8217;?&#8217;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6700\u5f8c\u306b\u3001\u4ee5\u4e0b\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> ascii_unsupported<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span><span class=\"token string\">'ascii'<\/span><span class=\"token punctuation\">,<\/span> errors<span class=\"token operator\">=<\/span><span class=\"token string\">'xmlcharrefreplace'<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u51fa\u529b\u306f\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>b&#8217;&amp;#64262;&#8217;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3059\u3079\u3066\u306e\u5834\u5408\u306b\u304a\u3044\u3066\u3001Python\u306f\u30a8\u30e9\u30fc\u3092\u8868\u793a\u3057\u307e\u305b\u3093\u3002<\/p>\n<p>\u524d\u306e\u4f8b\u3067\u793a\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u3001ignore\u306f\u30a8\u30f3\u30b3\u30fc\u30c9\u3067\u304d\u306a\u3044\u6587\u5b57\u3092\u7121\u8996\u3057\u3001replace\u306f\u6587\u5b57\u3092?\u3067\u7f6e\u304d\u63db\u3048\u3001xmlcharrefreplace\u306f\u30a8\u30f3\u30b3\u30fc\u30c9\u3067\u304d\u306a\u3044\u6587\u5b57\u3092XML\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n<h3>UnicodeDecodeError\u306e\u89e3\u6c7a<\/h3>\n<p>\u6307\u5b9a\u3055\u308c\u305f\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u306f\u8868\u73fe\u3067\u304d\u306a\u3044\u6587\u5b57\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u6587\u5b57\u5217\u3092\u30c7\u30b3\u30fc\u30c9\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001UnicodeDecodeError\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305b\u308b\u305f\u3081\u306b\u3001\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u30c7\u30b3\u30fc\u30c9\u3067\u304d\u306a\u3044\u30d0\u30a4\u30c8\u6587\u5b57\u5217\u3092\u30c7\u30b3\u30fc\u30c9\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u958b\u304d\u3001\u6b21\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 (Kons\u014dru o hiraki, tsugi no y\u014d ni ny\u016bryoku shite kudasai.)<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> iso_supported <span class=\"token operator\">=<\/span> <span class=\"token string\">'\u00a7'<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> b <span class=\"token operator\">=<\/span> iso_supported<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span><span class=\"token string\">'iso8859_1'<\/span><span class=\"token punctuation\">)<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> b<span class=\"token punctuation\">.<\/span>decode<span class=\"token punctuation\">(<\/span><span class=\"token string\">'utf-8'<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Traceback (most recent call last): File &#8220;&lt;stdin&gt;&#8221;, line 1, in &lt;module&gt; UnicodeDecodeError: &#8216;utf-8&#8217; codec can&#8217;t decode byte 0xa7 in position 0: invalid start byte<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30a8\u30e9\u30fc\u306b\u906d\u9047\u3057\u305f\u5834\u5408\u3001\u6587\u5b57\u5217\u3092\u30c7\u30b3\u30fc\u30c9\u3059\u308b\u969b\u306b\u306fdecode()\u95a2\u6570\u5185\u306eerrors\u5f15\u6570\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u5f15\u6570\u306f\u3001ignore\u3068replace\u306e2\u3064\u306e\u5024\u3092\u53d7\u3051\u4ed8\u3051\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u8a3c\u660e\u3059\u308b\u305f\u3081\u306b\u3001Python\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u958b\u304d\u3001\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> iso_supported <span class=\"token operator\">=<\/span> <span class=\"token string\">'\u00a7A'<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> b <span class=\"token operator\">=<\/span> iso_supported<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span><span class=\"token string\">'iso8859_1'<\/span><span class=\"token punctuation\">)<\/span>\r\n<span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> b<span class=\"token punctuation\">.<\/span>decode<span class=\"token punctuation\">(<\/span><span class=\"token string\">'utf-8'<\/span><span class=\"token punctuation\">,<\/span> errors<span class=\"token operator\">=<\/span><span class=\"token string\">'replace'<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u3042\u306a\u305f\u306e\u51fa\u529b\u7d50\u679c\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&#8216;\ufffdA&#8217;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306b\u3001\u4ee5\u4e0b\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token operator\">&gt;&gt;<\/span><span class=\"token operator\">&gt;<\/span> b<span class=\"token punctuation\">.<\/span>decode<span class=\"token punctuation\">(<\/span><span class=\"token string\">'utf-8'<\/span><span class=\"token punctuation\">,<\/span> errors<span class=\"token operator\">=<\/span><span class=\"token string\">'ignore'<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u3042\u306a\u305f\u306e\u51fa\u529b\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&#8216;A&#8217;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u524d\u8ff0\u306e\u4f8b\u3067\u306f\u3001decode()\u95a2\u6570\u3067replace\u5024\u3092\u4f7f\u7528\u3059\u308b\u3068\u300c\ufffd\u300d\u6587\u5b57\u304c\u8ffd\u52a0\u3055\u308c\u3001ignore\u3092\u4f7f\u7528\u3059\u308b\u3068\u30c7\u30b3\u30fc\u30c0\uff08\u3053\u306e\u5834\u5408\u306futf-8\uff09\u304c\u30d0\u30a4\u30c8\u3092\u30c7\u30b3\u30fc\u30c9\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u4f55\u3082\u8fd4\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u6587\u5b57\u5217\u3092\u89e3\u8aad\u3059\u308b\u969b\u306f\u3001\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u304c\u4f55\u3067\u3042\u308b\u304b\u3092\u60f3\u5b9a\u3067\u304d\u306a\u3044\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u6587\u5b57\u5217\u3092\u89e3\u8aad\u3059\u308b\u306b\u306f\u3001\u305d\u308c\u304c\u3069\u306e\u3088\u3046\u306b\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u305f\u304b\u3092\u77e5\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Python\u3067Unicode\u3092\u4f7f\u7528\u3059\u308b\u57fa\u672c\u7684\u306a\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3057\u305f\u3002\u6587\u5b57\u5217\u3092\u30a8\u30f3\u30b3\u30fc\u30c9\u304a\u3088\u3073\u30c7\u30b3\u30fc\u30c9\u3057\u3001NFD\u3001NFC\u3001NFKD\u3001NFKC\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u3092\u6b63\u898f\u5316\u3057\u3001Unicode\u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3057\u307e\u3057\u305f\u3002\u307e\u305f\u3001\u30bd\u30fc\u30c8\u3084\u691c\u7d22\u306b\u6b63\u898f\u5316\u5f62\u3092\u4f7f\u7528\u3059\u308b\u30b7\u30ca\u30ea\u30aa\u306b\u3064\u3044\u3066\u3082\u8aac\u660e\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u306e\u30c6\u30af\u30cb\u30c3\u30af\u306fPython\u3092\u4f7f\u7528\u3057\u3066Unicode\u306e\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3068\u3057\u3066\u3001unicodedata\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u8aad\u3093\u3067\u3001\u3053\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u63d0\u4f9b\u3059\u308b\u305d\u306e\u4ed6\u306e\u6a5f\u80fd\u306b\u3064\u3044\u3066\u5b66\u3076\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002Python\u3067\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3055\u3089\u306b\u63a2\u6c42\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u5f53\u793e\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u30b7\u30ea\u30fc\u30ba\u300cPython 3\u3067\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u65b9\u6cd5\u300d\u3092\u8aad\u3093\u3067\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8457\u8005\u306f\u300cWrite for Donations\u300d\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001\u5bc4\u4ed8\u3092\u53d7\u3051\u308b\u305f\u3081\u306b\u30d5\u30ea\u30fc\u3067\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u57fa\u91d1\u3092\u9078\u629e\u3057\u307e\u3057\u305f\u3002 \u30a4\u30f3\u30c8\u30ed\u30c0\u30af\u30b7\u30e7\u30f3 Unicode\u306f\u3001\u4e16\u754c\u306e\u307b\u3068\u3093\u3069\u306e\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u306b\u304a\u3051\u308b\u6a19\u6e96\u7684\u306a\u6587 [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[31,26],"class_list":["post-140","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-python","tag-26"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/python\u3067unicode\u3092\u6271\u3046\u65b9\u6cd5\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5\" \/>\n<meta property=\"og:description\" content=\"Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/python\u3067unicode\u3092\u6271\u3046\u65b9\u6cd5\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-11T18:50:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T12:05:13+00:00\" \/>\n<meta name=\"author\" content=\"\u6d77\u6597, \u8475\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6d77\u6597, \u8475\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"25\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95\/\",\"name\":\"Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2022-08-11T18:50:06+00:00\",\"dateModified\":\"2025-07-31T12:05:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6\"},\"description\":\"Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6\",\"name\":\"\u6d77\u6597, \u8475\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g\",\"caption\":\"\u6d77\u6597, \u8475\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/kaitoaoi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5 - Blog - Silicon Cloud","description":"Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/python\u3067unicode\u3092\u6271\u3046\u65b9\u6cd5\/","og_locale":"ja_JP","og_type":"article","og_title":"Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5","og_description":"Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/python\u3067unicode\u3092\u6271\u3046\u65b9\u6cd5\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-08-11T18:50:06+00:00","article_modified_time":"2025-07-31T12:05:13+00:00","author":"\u6d77\u6597, \u8475","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u6d77\u6597, \u8475","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"25\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95\/","name":"Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2022-08-11T18:50:06+00:00","dateModified":"2025-07-31T12:05:13+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6"},"description":"Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Python\u3067Unicode\u3092\u6271\u3046\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6","name":"\u6d77\u6597, \u8475","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g","caption":"\u6d77\u6597, \u8475"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/kaitoaoi\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/python%e3%81%a7unicode%e3%82%92%e6%89%b1%e3%81%86%e6%96%b9%e6%b3%95\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=140"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/140\/revisions"}],"predecessor-version":[{"id":36888,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/140\/revisions\/36888"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}