id: 832f48f4aed64b3ca8996b33aca11f60
parent_id: 
item_type: 1
item_id: 47d87ec0e4b74f6d8dd93228024cb40d
item_updated_time: 1764345469519
title_diff: "[{\"diffs\":[[1,\"Python程式移轉Outlook PST至Gmail\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":27}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>Python程式移轉Outlook PST至Gmail</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"3830\\\"></a>\\\r\\\n<h1>Python程式移轉Outlook PST至Gmail</h1>\\\r\\\n\\\r\\\n<div><span>\\\n  <div style=\\\"--en-clipped-content:article\\\">\\\n<div><br/></div><div style=\\\"font-size: 16px; display:block; min-width: 100%; position: relative;\\\"> <div style=\\\"box-sizing:border-box;text-size-adjust:100%;font-feature-settings:normal;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-variation-settings:normal;line-height:1.5;tab-size:4;color-scheme:light;\\\"><div style=\\\"box-sizing:border-box;line-height:inherit;-webkit-font-smoothing:antialiased;\\\"><div style=\\\"box-sizing:border-box;\\\"><div style=\\\"box-sizing:border-box;overflow:hidden;\\\"><div style=\\\"box-sizing:border-box;overflow:hidden;\\\"><span style=\\\"box-sizing:border-box;overflow:auto;transition-duration:0.15s;transition-property:width;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);\\\"><div style=\\\"box-sizing:border-box;display:flex;flex-direction:column;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex:1 1 0%;overflow:hidden;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;height:100%;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;height:100%;overflow-y:auto;width:100%;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;font-size:14px;line-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:sticky;top:0px;z-index:10;width:100%;background-color:rgb(255, 255, 255);transform:translateY(0%);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;z-index:20;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(255, 255, 255);padding:8px;color:rgb(142, 142, 160);min-height:60px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:1;flex-direction:row;display:flex;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;height:44px;width:44px;\\\"></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex:1 1 0%;flex-grow:1;align-items:center;gap:4px;color:rgb(86, 88, 105);justify-content:center;padding:0px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">Default (GPT-3.5)</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-shrink:1;flex-direction:row;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"></span></span></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;\\\"><img height=\\\"36\\\" src=\\\"https://s.gravatar.com/avatar/a258f20fcfeb877e2d761fd54f32ecbe?s=480&amp;r=pg&amp;d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fkh.png\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;height:auto;max-width:100%;border-radius:2px;color:transparent;\\\" width=\\\"36\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">我有一個outlook備份的pst檔，我需要把它移轉到到我的Gmail郵箱，請你幫忙用python設計一個程式來做這個事情。</div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 32, 0);gap:4px;align-self:center;padding-left:8px;\\\"></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(247, 247, 248);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;height:36px;width:36px;align-items:center;justify-content:center;border-radius:2px;padding:4px;color:rgb(255, 255, 255);background-color:rgb(25, 195, 125);\\\"><img src=\\\"data:image/svg+xml,%3csvg width='41' height='41' viewBox='0 0 41 41' fill='none' xmlns='http://www.w3.org/2000/svg' class='icon-md js-evernote-checked' role='img' data-evernote-id='263'%3e%3ctext x='-9999' y='-9999' data-evernote-id='264' class='js-evernote-checked'%3eChatGPT%3c/text%3e%3cpath d='M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z' fill='currentColor' data-evernote-id='265' class='js-evernote-checked'%3e%3c/path%3e%3c/svg%3e\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;stroke-width:1.5;height:20px;width:20px;\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(55, 65, 81);font-size:16px;line-height:1.75;width:100%;overflow-wrap:break-word;max-width:none;\\\"><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:0px;\\\">對於移轉 Outlook PST 檔至 Gmail 郵箱，您可以使用 Python 中的一些庫來達成這個目標。首先，您需要使用 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>pytz<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 库來處理時區，然後使用 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>imaplib<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 和 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>email<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 库來連接到 Gmail 郵箱並將郵件傳送至 Gmail。</p><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">以下是一個簡單的程式示例，假設您已經將 PST 檔轉換為 EML 文件，並存儲在本地文件夾中。這個示例會將 EML 文件上傳到 Gmail 郵箱。</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">python</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> os\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> email\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> imaplib <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> IMAP4_SSL\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email.mime.multipart <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> MIMEMultipart\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email.mime.text <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> MIMEText\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email.mime.base <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> MIMEBase\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> encoders\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">create_email_message</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">to, subject, message_text, attachment_path=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">None</span></span>):\\\n    msg = MIMEMultipart()\\\n    msg[<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'To'</span>] = to\\\n    msg[<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'Subject'</span>] = subject\\\n    msg.attach(MIMEText(message_text, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'plain'</span>))\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> attachment_path:\\\n        part = MIMEBase(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'application'</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'octet-stream'</span>)\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">with</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(attachment_path, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'rb'</span>) <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> attachment:\\\n            part.set_payload(attachment.read())\\\n        encoders.encode_base64(part)\\\n        part.add_header(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'Content-Disposition'</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">f'attachment; filename=&quot;<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">{os.path.basename(attachment_path)}</span>&quot;'</span>)\\\n        msg.attach(part)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">return</span> msg\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">send_email</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">username, password, to, msg</span>):\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">with</span> IMAP4_SSL(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'imap.gmail.com'</span>) <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> imap:\\\n        imap.login(username, password)\\\n        imap.select(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'inbox'</span>)\\\n        imap.append(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'inbox'</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">None</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">None</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">str</span>(msg).encode(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'utf-8'</span>))\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># 設定Gmail帳戶信息</span>\\\ngmail_username = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'YOUR_GMAIL_USERNAME'</span>\\\ngmail_password = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'YOUR_GMAIL_PASSWORD'</span>\\\nto_address = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'TO_EMAIL_ADDRESS'</span>\\\nsubject = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'Test Email'</span>\\\nmessage_text = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'This is a test email.'</span>\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># 指定EML文件路径</span>\\\neml_file_path = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'path/to/eml/file.eml'</span>\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># 創建郵件消息</span>\\\nemail_message = create_email_message(to_address, subject, message_text, eml_file_path)\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># 發送郵件</span>\\\nsend_email(gmail_username, gmail_password, to_address, email_message)\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">print</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'Email sent successfully!'</span>)\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">請注意替換 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'YOUR_GMAIL_USERNAME'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code>、<code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'YOUR_GMAIL_PASSWORD'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code>、<code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'TO_EMAIL_ADDRESS'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 和 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'path/to/eml/file.eml'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 為您的 Gmail 帳戶信息、收件人地址和 EML 文件的實際路徑。</p><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">請確保您的 Gmail 帳戶允許使用應用程式密碼，並且嘗試這個程式之前，請確保已安裝所需的 Python 库，例如 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>pytz<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code>。您可以使用以下命令安裝：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">bash</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span>pip install pytz\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:0px;\\\">請注意，這只是一個基本示例，實際情況可能因郵件的格式、附件的大小等而有所不同。建議在真實情況下對程式進行測試和調整。</p></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;justify-content:space-between;display:block;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 88, 0);gap:4px;align-self:center;padding-left:8px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;gap:4px;\\\"></div></div></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;\\\"><img height=\\\"36\\\" src=\\\"https://s.gravatar.com/avatar/a258f20fcfeb877e2d761fd54f32ecbe?s=480&amp;r=pg&amp;d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fkh.png\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;height:auto;max-width:100%;border-radius:2px;color:transparent;\\\" width=\\\"36\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">因爲我不是專業的程式設計師，只想用最簡單的方法，請問建議測試debug用什麽工具比較合適？</div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 32, 0);gap:4px;align-self:center;padding-left:8px;\\\"></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(247, 247, 248);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;height:36px;width:36px;align-items:center;justify-content:center;border-radius:2px;padding:4px;color:rgb(255, 255, 255);background-color:rgb(25, 195, 125);\\\"><img src=\\\"data:image/svg+xml,%3csvg width='41' height='41' viewBox='0 0 41 41' fill='none' xmlns='http://www.w3.org/2000/svg' class='icon-md js-evernote-checked' role='img' data-evernote-id='411'%3e%3ctext x='-9999' y='-9999' data-evernote-id='412' class='js-evernote-checked'%3eChatGPT%3c/text%3e%3cpath d='M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z' fill='currentColor' data-evernote-id='413' class='js-evernote-checked'%3e%3c/path%3e%3c/svg%3e\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;stroke-width:1.5;height:20px;width:20px;\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(55, 65, 81);font-size:16px;line-height:1.75;width:100%;overflow-wrap:break-word;max-width:none;\\\"><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:0px;\\\">如果您想使用最簡單且輕量級的工具來進行測試和 debug，以下工具是不錯的選擇，特別適合非專業程式設計師或初學者：</p><ol style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;list-style:none;margin:0px;padding:0px;display:flex;flex-direction:column;margin-bottom:1.25em;margin-top:1.25em;list-style-type:decimal;padding-left:1.625em;\\\"><li style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;min-height:28px;margin-bottom:0.5em;margin-top:0.5em;padding-left:0.375em;\\\"><span style=\\\"--tw-translate-x:-100%;--tw-numeric-spacing:tabular-nums;--tw-text-opacity:1;color:rgba(142,142,160,var(--tw-text-opacity));font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);padding-right:0.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\\\">counters(list-number,.) .</span><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\"><strong style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(17, 24, 39);font-weight:600;\\\">Print Statements (print 語句)</strong>\\\n使用 Python 的 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>print<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 語句是最簡單的 debug 方法。您可以在程式碼中插入 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>print<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 語句來顯示變量的值、程式流程等，這可以幫助您了解程式在運行時的狀態。</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;margin-bottom:1.25em;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">python</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">print</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;Variable value:&quot;</span>, variable)\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre></li><li style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;min-height:28px;margin-bottom:0.5em;margin-top:0.5em;padding-left:0.375em;\\\"><span style=\\\"--tw-translate-x:-100%;--tw-numeric-spacing:tabular-nums;--tw-text-opacity:1;color:rgba(142,142,160,var(--tw-text-opacity));font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);padding-right:0.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\\\">counters(list-number,.) .</span><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\"><strong style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(17, 24, 39);font-weight:600;\\\">Integrated Development Environment (IDE)</strong>\\\n使用 IDE 可以使得測試和 debug 變得更容易。一些簡單且適合初學者的 IDE 包括：</p><ul style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;list-style:none;margin:0px;padding:0px;display:flex;flex-direction:column;margin-left:16px;list-style-type:disc;padding-left:1.625em;margin-top:0.75em;margin-bottom:1.25em;\\\"><li style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;margin:0px;min-height:28px;margin-bottom:0.5em;margin-top:0.5em;padding-left:0.375em;\\\"><span style=\\\"--tw-translate-x:-100%;font-size:0.875rem;line-height:1.25rem;padding-right:0.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\\\">•</span><strong style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(17, 24, 39);font-weight:600;\\\">Thonny</strong>: 一款針對初學者的 Python IDE，具有簡潔的介面和易於使用的功能。</li><li style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;margin:0px;min-height:28px;margin-bottom:0.5em;margin-top:0.5em;padding-left:0.375em;\\\"><span style=\\\"--tw-translate-x:-100%;font-size:0.875rem;line-height:1.25rem;padding-right:0.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\\\">•</span><strong style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(17, 24, 39);font-weight:600;\\\">PyCharm (Community Edition)</strong>: PyCharm 提供了強大的功能和良好的調試工具，即使是初學者也可以使用其簡單版本（Community Edition）。</li><li style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;margin:0px;min-height:28px;margin-bottom:0.5em;margin-top:0.5em;padding-left:0.375em;\\\"><span style=\\\"--tw-translate-x:-100%;font-size:0.875rem;line-height:1.25rem;padding-right:0.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\\\">•</span><strong style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(17, 24, 39);font-weight:600;\\\">Visual Studio Code</strong>: 具有豐富擴展和調試功能，並且可以安裝適用於 Python 的擴展。</li></ul></li><li style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;min-height:28px;margin-bottom:0.5em;margin-top:0.5em;padding-left:0.375em;\\\"><span style=\\\"--tw-translate-x:-100%;--tw-numeric-spacing:tabular-nums;--tw-text-opacity:1;color:rgba(142,142,160,var(--tw-text-opacity));font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);padding-right:0.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\\\">counters(list-number,.) .</span><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:1.25em;\\\"><strong style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(17, 24, 39);font-weight:600;\\\">Online Python Editors</strong>\\\n如果您不想安裝 IDE，可以使用線上的 Python 編輯器進行快速編碼、測試和 debug。一些常見的線上 Python 編輯器包括 Repl.it、Jupyter Notebook、PythonAnywhere 等。</p></li><li style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;min-height:28px;margin-bottom:0.5em;margin-top:0.5em;padding-left:0.375em;\\\"><span style=\\\"--tw-translate-x:-100%;--tw-numeric-spacing:tabular-nums;--tw-text-opacity:1;color:rgba(142,142,160,var(--tw-text-opacity));font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);padding-right:0.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\\\">counters(list-number,.) .</span><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:1.25em;\\\"><strong style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(17, 24, 39);font-weight:600;\\\">Jupyter Notebook</strong>\\\nJupyter Notebook 是一種交互式編程環境，可以進行即時測試和 debug。它以 cell 為單位運行程式碼，並能夠即時查看變量的值。</p></li><li style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;min-height:28px;margin-bottom:0.5em;margin-top:0.5em;padding-left:0.375em;\\\"><span style=\\\"--tw-translate-x:-100%;--tw-numeric-spacing:tabular-nums;--tw-text-opacity:1;color:rgba(142,142,160,var(--tw-text-opacity));font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);padding-right:0.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\\\">counters(list-number,.) .</span><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:1.25em;\\\"><strong style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(17, 24, 39);font-weight:600;\\\">Debugger in Python (pdb)</strong>\\\nPython 提供了內建的調試器，稱為 pdb（Python Debugger）。您可以使用它來設置斷點、檢查變量的值、逐步執行程式等。</p></li></ol><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:0px;\\\">綜合考慮您的需求和經驗水平，您可以選擇適合您的測試和 debug 工具。對於最簡單的 debug 需求，使用 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>print<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 語句可能是最直接和易於理解的方式。</p></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;justify-content:space-between;display:block;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 88, 0);gap:4px;align-self:center;padding-left:8px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;gap:4px;\\\"></div></div></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;\\\"><img height=\\\"36\\\" src=\\\"https://s.gravatar.com/avatar/a258f20fcfeb877e2d761fd54f32ecbe?s=480&amp;r=pg&amp;d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fkh.png\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;height:auto;max-width:100%;border-radius:2px;color:transparent;\\\" width=\\\"36\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">因爲我的PST檔似乎有編碼的問題，有可能不是標準的UTF8，或是有相容性的問題，可以麻煩你修改一下程式碼，讓它可以在發送到Gmail的時候，順便做編碼的轉換嗎？</div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 32, 0);gap:4px;align-self:center;padding-left:8px;\\\"></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(247, 247, 248);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;height:36px;width:36px;align-items:center;justify-content:center;border-radius:2px;padding:4px;color:rgb(255, 255, 255);background-color:rgb(25, 195, 125);\\\"><img src=\\\"data:image/svg+xml,%3csvg width='41' height='41' viewBox='0 0 41 41' fill='none' xmlns='http://www.w3.org/2000/svg' class='icon-md js-evernote-checked' role='img' data-evernote-id='512'%3e%3ctext x='-9999' y='-9999' data-evernote-id='513' class='js-evernote-checked'%3eChatGPT%3c/text%3e%3cpath d='M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z' fill='currentColor' data-evernote-id='514' class='js-evernote-checked'%3e%3c/path%3e%3c/svg%3e\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;stroke-width:1.5;height:20px;width:20px;\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(55, 65, 81);font-size:16px;line-height:1.75;width:100%;overflow-wrap:break-word;max-width:none;\\\"><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:0px;\\\">當處理可能具有不同編碼或相容性問題的郵件內容時，確保轉換編碼並適當處理可能出現的例外情況是重要的。以下是經過修改以支援編碼轉換的程式碼示例：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">python</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> os\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> email\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> imaplib <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> IMAP4_SSL\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email.mime.multipart <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> MIMEMultipart\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email.mime.text <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> MIMEText\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email.mime.base <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> MIMEBase\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> encoders\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">create_email_message</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">to, subject, message_text, attachment_path=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">None</span>, encoding=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'utf-8'</span></span>):\\\n    msg = MIMEMultipart()\\\n    msg[<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'To'</span>] = to\\\n    msg[<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'Subject'</span>] = subject\\\n    msg.attach(MIMEText(message_text, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'plain'</span>, _charset=encoding))\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> attachment_path:\\\n        part = MIMEBase(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'application'</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'octet-stream'</span>)\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">with</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(attachment_path, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'rb'</span>) <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> attachment:\\\n            part.set_payload(attachment.read())\\\n        encoders.encode_base64(part)\\\n        part.add_header(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'Content-Disposition'</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">f'attachment; filename=&quot;<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">{os.path.basename(attachment_path)}</span>&quot;'</span>)\\\n        msg.attach(part)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">return</span> msg\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">send_email</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">username, password, to, msg</span>):\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">with</span> IMAP4_SSL(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'imap.gmail.com'</span>) <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> imap:\\\n        imap.login(username, password)\\\n        imap.select(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'inbox'</span>)\\\n        imap.append(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'inbox'</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">None</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">None</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">str</span>(msg).encode(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'utf-8'</span>))\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># 設定Gmail帳戶信息</span>\\\ngmail_username = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'YOUR_GMAIL_USERNAME'</span>\\\ngmail_password = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'YOUR_GMAIL_PASSWORD'</span>\\\nto_address = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'TO_EMAIL_ADDRESS'</span>\\\nsubject = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'Test Email'</span>\\\nmessage_text = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'This is a test email.'</span>\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># 指定EML文件路径</span>\\\neml_file_path = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'path/to/eml/file.eml'</span>\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># 創建郵件消息，進行編碼轉換</span>\\\nemail_message = create_email_message(to_address, subject, message_text, eml_file_path, encoding=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'utf-8'</span>)\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># 發送郵件</span>\\\nsend_email(gmail_username, gmail_password, to_address, email_message)\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">print</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'Email sent successfully!'</span>)\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">在這個修改後的程式碼中，<code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>create_email_message<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 函數現在接受一個 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>encoding<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 參數，用於指定要使用的編碼。在創建郵件消息時，將適當地使用指定的編碼進行文本內容的設置。</p><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:0px;\\\">請確保替換 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'YOUR_GMAIL_USERNAME'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code>、<code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'YOUR_GMAIL_PASSWORD'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code>、<code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'TO_EMAIL_ADDRESS'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 和 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'path/to/eml/file.eml'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 為您的 Gmail 帳戶信息、收件人地址和 EML 文件的實際路徑。</p></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;justify-content:space-between;display:block;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 88, 0);gap:4px;align-self:center;padding-left:8px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;gap:4px;\\\"></div></div></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;\\\"><img height=\\\"36\\\" src=\\\"https://s.gravatar.com/avatar/a258f20fcfeb877e2d761fd54f32ecbe?s=480&amp;r=pg&amp;d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fkh.png\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;height:auto;max-width:100%;border-radius:2px;color:transparent;\\\" width=\\\"36\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">你這個程式是假設我已經將PST檔轉成了EML文件了嗎？但是我沒有PST轉換成EML的工具啊！麻煩將這一段PST轉換成EML的程式碼也加上去。</div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 32, 0);gap:4px;align-self:center;padding-left:8px;\\\"></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(247, 247, 248);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;height:36px;width:36px;align-items:center;justify-content:center;border-radius:2px;padding:4px;color:rgb(255, 255, 255);background-color:rgb(25, 195, 125);\\\"><img src=\\\"data:image/svg+xml,%3csvg width='41' height='41' viewBox='0 0 41 41' fill='none' xmlns='http://www.w3.org/2000/svg' class='icon-md js-evernote-checked' role='img' data-evernote-id='648'%3e%3ctext x='-9999' y='-9999' data-evernote-id='649' class='js-evernote-checked'%3eChatGPT%3c/text%3e%3cpath d='M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z' fill='currentColor' data-evernote-id='650' class='js-evernote-checked'%3e%3c/path%3e%3c/svg%3e\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;stroke-width:1.5;height:20px;width:20px;\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(55, 65, 81);font-size:16px;line-height:1.75;width:100%;overflow-wrap:break-word;max-width:none;\\\"><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:0px;\\\">抱歉我之前的回答可能有誤解。將 PST 轉換為 EML 文件需要使用特定的工具或庫。在 Python 中，您可以使用 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>exchangelib<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 库來從 PST 文件中提取郵件並保存為 EML 文件。</p><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">首先，您需要安裝 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>exchangelib<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 库。您可以使用以下命令來安裝：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">bash</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span>pip install exchangelib\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">然後，以下是將 PST 文件中的郵件轉換為 EML 文件的程式碼：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">python</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> exchangelib <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> Credentials, Account, DELEGATE\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> os\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> email\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> policy\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email.parser <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> BytesParser\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">extract_emails_from_pst</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">pst_file_path, output_dir</span>):\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Set your Exchange server and credentials</span>\\\n    exchange_server = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'YOUR_EXCHANGE_SERVER'</span>\\\n    email_address = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'YOUR_EMAIL_ADDRESS'</span>\\\n    password = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'YOUR_PASSWORD'</span>\\\n\\\n    credentials = Credentials(email_address, password)\\\n    account = Account(email_address, credentials=credentials, autodiscover=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">True</span>, access_type=DELEGATE)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Iterate through the messages in the PST file and save as EML</span>\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> item <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> account.root.get_items():\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">isinstance</span>(item, Message):\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Parse the email message</span>\\\n            msg = BytesParser(policy=policy.default).parsebytes(item.mime_content)\\\n            eml_file_path = os.path.join(output_dir, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">f'<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">{item.subject}</span>.eml'</span>)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Save the email as EML file</span>\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">with</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(eml_file_path, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'wb'</span>) <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> eml_file:\\\n                eml_file.write(item.mime_content)\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> __name__ == <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;__main__&quot;</span>:\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Specify the path to the PST file and the output directory</span>\\\n    pst_file_path = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'path/to/your.pst'</span>\\\n    output_dir = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'path/to/output/directory'</span>\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Create the output directory if it doesn't exist</span>\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">not</span> os.path.exists(output_dir):\\\n        os.makedirs(output_dir)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Extract emails from PST and save as EML</span>\\\n    extract_emails_from_pst(pst_file_path, output_dir)\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:0px;\\\">請替換 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>YOUR_EXCHANGE_SERVER<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code>、<code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>YOUR_EMAIL_ADDRESS<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code>、<code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>YOUR_PASSWORD<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code>、<code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>path/to/your.pst<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 和 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>path/to/output/directory<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 為您的 Exchange 伺服器、電子郵件地址、密碼、PST 文件的實際路徑以及您希望將 EML 文件保存的目錄。這段程式碼會提取 PST 文件中的郵件，並將每封郵件保存為一個獨立的 EML 文件。</p></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;justify-content:space-between;display:block;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 88, 0);gap:4px;align-self:center;padding-left:8px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;gap:4px;\\\"></div></div></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;\\\"><img height=\\\"36\\\" src=\\\"https://s.gravatar.com/avatar/a258f20fcfeb877e2d761fd54f32ecbe?s=480&amp;r=pg&amp;d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fkh.png\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;height:auto;max-width:100%;border-radius:2px;color:transparent;\\\" width=\\\"36\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">我希望PST转EML</div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 32, 0);gap:4px;align-self:center;padding-left:8px;\\\"></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(247, 247, 248);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;height:36px;width:36px;align-items:center;justify-content:center;border-radius:2px;padding:4px;color:rgb(255, 255, 255);background-color:rgb(25, 195, 125);\\\"><img src=\\\"data:image/svg+xml,%3csvg width='41' height='41' viewBox='0 0 41 41' fill='none' xmlns='http://www.w3.org/2000/svg' class='icon-md js-evernote-checked' role='img' data-evernote-id='778'%3e%3ctext x='-9999' y='-9999' data-evernote-id='779' class='js-evernote-checked'%3eChatGPT%3c/text%3e%3cpath d='M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z' fill='currentColor' data-evernote-id='780' class='js-evernote-checked'%3e%3c/path%3e%3c/svg%3e\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;stroke-width:1.5;height:20px;width:20px;\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(55, 65, 81);font-size:16px;line-height:1.75;width:100%;overflow-wrap:break-word;max-width:none;\\\"><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:0px;margin-bottom:0px;\\\">了解了。要將 PST 文件轉換為 EML 格式，您可以使用 &quot;libpff&quot; 库。這個庫允許您從 PST 文件中提取郵件並將其保存為 EML 文件。首先，您需要安裝 `lib</p></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;justify-content:space-between;display:block;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 88, 0);gap:4px;align-self:center;padding-left:8px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;gap:4px;\\\"></div></div></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;\\\"><img height=\\\"36\\\" src=\\\"https://s.gravatar.com/avatar/a258f20fcfeb877e2d761fd54f32ecbe?s=480&amp;r=pg&amp;d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fkh.png\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;height:auto;max-width:100%;border-radius:2px;color:transparent;\\\" width=\\\"36\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">我希望PST转EML的这个程序有具备编码转换的功能，麻烦你把它加进去</div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 32, 0);gap:4px;align-self:center;padding-left:8px;\\\"></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(247, 247, 248);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;height:36px;width:36px;align-items:center;justify-content:center;border-radius:2px;padding:4px;color:rgb(255, 255, 255);background-color:rgb(25, 195, 125);\\\"><img src=\\\"data:image/svg+xml,%3csvg width='41' height='41' viewBox='0 0 41 41' fill='none' xmlns='http://www.w3.org/2000/svg' class='icon-md js-evernote-checked' role='img' data-evernote-id='840'%3e%3ctext x='-9999' y='-9999' data-evernote-id='841' class='js-evernote-checked'%3eChatGPT%3c/text%3e%3cpath d='M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z' fill='currentColor' data-evernote-id='842' class='js-evernote-checked'%3e%3c/path%3e%3c/svg%3e\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;stroke-width:1.5;height:20px;width:20px;\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(55, 65, 81);font-size:16px;line-height:1.75;width:100%;overflow-wrap:break-word;max-width:none;\\\"><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:0px;\\\">理解了。在 PST 转换为 EML 的过程中添加编码转换功能是很重要的。下面是一个示例代码，将 PST 文件中的邮件转换为 EML 格式，并在转换过程中进行编码转换：</p><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">首先，确保已安装所需的库 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>libpff<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 和 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>email<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code>：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">bash</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span>pip install libpff-python\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">接下来，使用下面的代码进行 PST 转换为 EML，并在转换过程中进行编码转换：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">python</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> os\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> sys\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> libpff <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> file <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> libpff_file\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> policy\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email.parser <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> BytesParser\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">extract_emails_from_pst</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">pst_file_path, output_dir, encoding=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'utf-8'</span></span>):\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Open the PST file</span>\\\n    pst = libpff_file()\\\n    pst.<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(pst_file_path)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Iterate through the folders</span>\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> folder <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> pst.root_folders:\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Iterate through the messages in the folder</span>\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> message <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> folder.sub_messages:\\\n            eml_file_name = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">f&quot;<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">{message.subject}</span>.eml&quot;</span>\\\n            eml_file_path = os.path.join(output_dir, eml_file_name)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Parse the email message</span>\\\n            msg = BytesParser(policy=policy.default).parsebytes(message.mime_content)\\\n            msg.replace_header(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'Content-Transfer-Encoding'</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'quoted-printable'</span>)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Save the email as EML file with the specified encoding</span>\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">with</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(eml_file_path, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'w'</span>, encoding=encoding) <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> eml_file:\\\n                eml_file.write(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">str</span>(msg))\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Close the PST file</span>\\\n    pst.close()\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> __name__ == <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;__main__&quot;</span>:\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Specify the path to the PST file and the output directory</span>\\\n    pst_file_path = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'path/to/your.pst'</span>\\\n    output_dir = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'path/to/output/directory'</span>\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Create the output directory if it doesn't exist</span>\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">not</span> os.path.exists(output_dir):\\\n        os.makedirs(output_dir)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Extract emails from PST and save as EML with encoding conversion</span>\\\n    extract_emails_from_pst(pst_file_path, output_dir, encoding=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'utf-8'</span>)\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">请替换 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'path/to/your.pst'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 和 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'path/to/output/directory'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 为您的 PST 文件路径和希望保存 EML 文件的目录。</p><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:0px;\\\">这个程序将 PST 文件中的邮件转换为 EML 格式，并且在转换过程中可以指定编码。</p></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;justify-content:space-between;display:block;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 88, 0);gap:4px;align-self:center;padding-left:8px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;gap:4px;\\\"></div></div></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;\\\"><img height=\\\"36\\\" src=\\\"https://s.gravatar.com/avatar/a258f20fcfeb877e2d761fd54f32ecbe?s=480&amp;r=pg&amp;d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fkh.png\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;height:auto;max-width:100%;border-radius:2px;color:transparent;\\\" width=\\\"36\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">那一段程序码是用来改变编码的？</div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 32, 0);gap:4px;align-self:center;padding-left:8px;\\\"></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(247, 247, 248);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;height:36px;width:36px;align-items:center;justify-content:center;border-radius:2px;padding:4px;color:rgb(255, 255, 255);background-color:rgb(25, 195, 125);\\\"><img src=\\\"data:image/svg+xml,%3csvg width='41' height='41' viewBox='0 0 41 41' fill='none' xmlns='http://www.w3.org/2000/svg' class='icon-md js-evernote-checked' role='img' data-evernote-id='973'%3e%3ctext x='-9999' y='-9999' data-evernote-id='974' class='js-evernote-checked'%3eChatGPT%3c/text%3e%3cpath d='M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z' fill='currentColor' data-evernote-id='975' class='js-evernote-checked'%3e%3c/path%3e%3c/svg%3e\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;stroke-width:1.5;height:20px;width:20px;\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(55, 65, 81);font-size:16px;line-height:1.75;width:100%;overflow-wrap:break-word;max-width:none;\\\"><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:0px;\\\">在上面提供的程式碼中，編碼主要是在郵件內容轉換為 EML 時進行設置的。具體來說，我們使用了 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>email<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 模組中的 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>BytesParser<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 和 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>policy<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 來解析郵件並設置編碼。</p><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">以下是關於編碼的相關部分：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">python</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Parse the email message</span>\\\nmsg = BytesParser(policy=policy.default).parsebytes(message.mime_content)\\\nmsg.replace_header(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'Content-Transfer-Encoding'</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'quoted-printable'</span>)\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">在這裡，我們使用 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>BytesParser<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 解析郵件，並將 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>Content-Transfer-Encoding<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 設置為 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>quoted-printable<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code>。這個編碼是一種可用於將二進制數據轉換為ASCII字符的機制，通常用於郵件的傳輸。</p><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:0px;\\\">此外，您也可以根據需要更改編碼方式，例如使用 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>base64<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 或其他編碼方式。這取決於您的特定需求和郵件內容的特性。請根據您的情況選擇適當的編碼方式。</p></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;justify-content:space-between;display:block;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 88, 0);gap:4px;align-self:center;padding-left:8px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;gap:4px;\\\"></div></div></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;\\\"><img height=\\\"36\\\" src=\\\"https://s.gravatar.com/avatar/a258f20fcfeb877e2d761fd54f32ecbe?s=480&amp;r=pg&amp;d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fkh.png\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;height:auto;max-width:100%;border-radius:2px;color:transparent;\\\" width=\\\"36\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">你误会我的意思了，我的意思是我的原始PST档可能是Big5编码，但是我希望输出的EML档是标准的UTF8，请根据这个要求改写上面的程序</div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 32, 0);gap:4px;align-self:center;padding-left:8px;\\\"></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(247, 247, 248);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;height:36px;width:36px;align-items:center;justify-content:center;border-radius:2px;padding:4px;color:rgb(255, 255, 255);background-color:rgb(25, 195, 125);\\\"><img src=\\\"data:image/svg+xml,%3csvg width='41' height='41' viewBox='0 0 41 41' fill='none' xmlns='http://www.w3.org/2000/svg' class='icon-md js-evernote-checked' role='img' data-evernote-id='1058'%3e%3ctext x='-9999' y='-9999' data-evernote-id='1059' class='js-evernote-checked'%3eChatGPT%3c/text%3e%3cpath d='M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z' fill='currentColor' data-evernote-id='1060' class='js-evernote-checked'%3e%3c/path%3e%3c/svg%3e\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;stroke-width:1.5;height:20px;width:20px;\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(55, 65, 81);font-size:16px;line-height:1.75;width:100%;overflow-wrap:break-word;max-width:none;\\\"><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:0px;\\\">明白了，您希望將原始 PST 文件中的郵件轉換為 UTF-8 編碼的 EML 文件。以下是修改後的程式碼，將原始 PST 文件轉換為 UTF-8 編碼的 EML 文件：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">python</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> os\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> libpff <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> file <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> libpff_file\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> policy\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email.parser <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> BytesParser\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">extract_emails_from_pst</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">pst_file_path, output_dir</span>):\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Open the PST file</span>\\\n    pst = libpff_file()\\\n    pst.<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(pst_file_path)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Iterate through the folders</span>\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> folder <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> pst.root_folders:\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Iterate through the messages in the folder</span>\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> message <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> folder.sub_messages:\\\n            eml_file_name = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">f&quot;<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">{message.subject}</span>.eml&quot;</span>\\\n            eml_file_path = os.path.join(output_dir, eml_file_name)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Parse the email message</span>\\\n            msg = BytesParser(policy=policy.default).parsebytes(message.mime_content)\\\n            msg.replace_header(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'Content-Transfer-Encoding'</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'quoted-printable'</span>)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Convert the email content to UTF-8 encoding</span>\\\n            msg_text = msg.as_bytes().decode(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'big5'</span>, errors=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'replace'</span>).encode(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'utf-8'</span>)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Save the email as EML file with UTF-8 encoding</span>\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">with</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(eml_file_path, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'wb'</span>) <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> eml_file:\\\n                eml_file.write(msg_text)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Close the PST file</span>\\\n    pst.close()\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> __name__ == <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;__main__&quot;</span>:\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Specify the path to the PST file and the output directory</span>\\\n    pst_file_path = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'path/to/your.pst'</span>\\\n    output_dir = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'path/to/output/directory'</span>\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Create the output directory if it doesn't exist</span>\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">not</span> os.path.exists(output_dir):\\\n        os.makedirs(output_dir)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Extract emails from PST and save as EML with UTF-8 encoding</span>\\\n    extract_emails_from_pst(pst_file_path, output_dir)\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:0px;\\\">在這個修改後的程式碼中，我們將原始郵件的內容按照 Big5 編碼解碼，然後再編碼為 UTF-8。這樣，EML 文件的內容就會以 UTF-8 編碼保存。請替換 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'path/to/your.pst'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 和 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'path/to/output/directory'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 為您的 PST 文件路徑和 EML 文件希望保存的目錄。</p></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;justify-content:space-between;display:block;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 88, 0);gap:4px;align-self:center;padding-left:8px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;gap:4px;\\\"></div></div></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;\\\"><img height=\\\"36\\\" src=\\\"https://s.gravatar.com/avatar/a258f20fcfeb877e2d761fd54f32ecbe?s=480&amp;r=pg&amp;d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fkh.png\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;height:auto;max-width:100%;border-radius:2px;color:transparent;\\\" width=\\\"36\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">我保存的旧 pst 档是在 Windows XP 繁体中文版，现在我使用的是 Windows 11 简体中文版，我在 outlook 打开这个 pst 档，看到它的标题都是乱码但是邮件内容却是正常的，python 程序要如何解决这个问题呢？</div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 32, 0);gap:4px;align-self:center;padding-left:8px;\\\"></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(247, 247, 248);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;height:36px;width:36px;align-items:center;justify-content:center;border-radius:2px;padding:4px;color:rgb(255, 255, 255);background-color:rgb(25, 195, 125);\\\"><img src=\\\"data:image/svg+xml,%3csvg width='41' height='41' viewBox='0 0 41 41' fill='none' xmlns='http://www.w3.org/2000/svg' class='icon-md js-evernote-checked' role='img' data-evernote-id='1176'%3e%3ctext x='-9999' y='-9999' data-evernote-id='1177' class='js-evernote-checked'%3eChatGPT%3c/text%3e%3cpath d='M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z' fill='currentColor' data-evernote-id='1178' class='js-evernote-checked'%3e%3c/path%3e%3c/svg%3e\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;stroke-width:1.5;height:20px;width:20px;\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(55, 65, 81);font-size:16px;line-height:1.75;width:100%;overflow-wrap:break-word;max-width:none;\\\"><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:0px;\\\">当在不同地区或操作系统之间切换时，可能会出现编码问题，导致标题显示乱码。要解决这个问题，您可以尝试以下方法：</p><ol style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;list-style:none;margin:0px;padding:0px;display:flex;flex-direction:column;margin-bottom:1.25em;margin-top:1.25em;list-style-type:decimal;padding-left:1.625em;\\\"><li style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;min-height:28px;margin-bottom:0.5em;margin-top:0.5em;padding-left:0.375em;\\\"><span style=\\\"--tw-translate-x:-100%;--tw-numeric-spacing:tabular-nums;--tw-text-opacity:1;color:rgba(142,142,160,var(--tw-text-opacity));font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);padding-right:0.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\\\">counters(list-number,.) .</span><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\"><strong style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(17, 24, 39);font-weight:600;\\\">指定正确的编码：</strong> 在你的 Python 程序中，尝试使用正确的编码来解码标题。根据你的情况，Windows XP 繁体中文版通常使用 Big5 编码，而现代 Windows 操作系统使用 GBK 或 UTF-8 编码。所以你可以尝试不同的编码方式，例如：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">python</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span>title = message.subject.decode(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'big5'</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'ignore'</span>)\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">或</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">python</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span>title = message.subject.decode(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'gbk'</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'ignore'</span>)\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:1.25em;\\\">如果以上方式没有解决问题，你可以尝试其他编码方式。</p></li><li style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;min-height:28px;margin-bottom:0.5em;margin-top:0.5em;padding-left:0.375em;\\\"><span style=\\\"--tw-translate-x:-100%;--tw-numeric-spacing:tabular-nums;--tw-text-opacity:1;color:rgba(142,142,160,var(--tw-text-opacity));font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);padding-right:0.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\\\">counters(list-number,.) .</span><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:1.25em;\\\"><strong style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(17, 24, 39);font-weight:600;\\\">使用错误处理机制：</strong> 在解码标题时，使用错误处理机制来处理可能出现的异常字符。在上述示例中，我使用了 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'ignore'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 参数，它会忽略无法解码的字符，但你可以根据需要选择其他处理方式，如 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'replace'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code>。</p></li><li style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;min-height:28px;margin-bottom:0.5em;margin-top:0.5em;padding-left:0.375em;\\\"><span style=\\\"--tw-translate-x:-100%;--tw-numeric-spacing:tabular-nums;--tw-text-opacity:1;color:rgba(142,142,160,var(--tw-text-opacity));font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);padding-right:0.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\\\">counters(list-number,.) .</span><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\"><strong style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(17, 24, 39);font-weight:600;\\\">将标题重新编码为 UTF-8：</strong> 在标题解码后，将其重新编码为 UTF-8。这将确保标题以正确的编码方式在程序中使用。</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;margin-bottom:1.25em;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">python</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span>title = title.encode(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'utf-8'</span>)\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre></li><li style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;min-height:28px;margin-bottom:0.5em;margin-top:0.5em;padding-left:0.375em;\\\"><span style=\\\"--tw-translate-x:-100%;--tw-numeric-spacing:tabular-nums;--tw-text-opacity:1;color:rgba(142,142,160,var(--tw-text-opacity));font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);padding-right:0.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\\\">counters(list-number,.) .</span><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:1.25em;\\\"><strong style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(17, 24, 39);font-weight:600;\\\">调整系统区域和语言设置：</strong> 如果可能，尝试在 Windows 11 中将区域和语言设置与 Windows XP 保持一致，这可以帮助解决编码问题。</p></li></ol><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:0px;\\\">尝试以上方法后，应能够正确处理标题中的乱码问题。请根据实际情况选择最合适的编码方式和错误处理机制。</p></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;justify-content:space-between;display:block;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 88, 0);gap:4px;align-self:center;padding-left:8px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;gap:4px;\\\"></div></div></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;\\\"><img height=\\\"36\\\" src=\\\"https://s.gravatar.com/avatar/a258f20fcfeb877e2d761fd54f32ecbe?s=480&amp;r=pg&amp;d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fkh.png\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;height:auto;max-width:100%;border-radius:2px;color:transparent;\\\" width=\\\"36\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">根据以上的描述，请写一个 python 程序，能够修改邮件标题成为正确编码的完整程序。</div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 32, 0);gap:4px;align-self:center;padding-left:8px;\\\"></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(247, 247, 248);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;height:36px;width:36px;align-items:center;justify-content:center;border-radius:2px;padding:4px;color:rgb(255, 255, 255);background-color:rgb(25, 195, 125);\\\"><img src=\\\"data:image/svg+xml,%3csvg width='41' height='41' viewBox='0 0 41 41' fill='none' xmlns='http://www.w3.org/2000/svg' class='icon-md js-evernote-checked' role='img' data-evernote-id='1291'%3e%3ctext x='-9999' y='-9999' data-evernote-id='1292' class='js-evernote-checked'%3eChatGPT%3c/text%3e%3cpath d='M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z' fill='currentColor' data-evernote-id='1293' class='js-evernote-checked'%3e%3c/path%3e%3c/svg%3e\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;stroke-width:1.5;height:20px;width:20px;\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(55, 65, 81);font-size:16px;line-height:1.75;width:100%;overflow-wrap:break-word;max-width:none;\\\"><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:0px;\\\">以下是一个示例 Python 程序，可以修改邮件标题为正确编码的程序。假设原始邮件标题的编码是 Big5，我们将其解码为 UTF-8，同时处理可能出现的异常字符：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">python</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> os\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> libpff <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> file <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> libpff_file\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> policy\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email.parser <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> BytesParser\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">modify_subject_encoding</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">subject, source_encoding=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'big5'</span>, target_encoding=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'utf-8'</span></span>):\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">try</span>:\\\n        decoded_subject = subject.decode(source_encoding)\\\n        encoded_subject = decoded_subject.encode(target_encoding, errors=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'ignore'</span>)\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">return</span> encoded_subject\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">except</span> Exception <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> e:\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">print</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">f&quot;Error modifying subject: <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">{e}</span>&quot;</span>)\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">return</span> subject\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">extract_emails_from_pst</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">pst_file_path, output_dir</span>):\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Open the PST file</span>\\\n    pst = libpff_file()\\\n    pst.<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(pst_file_path)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Iterate through the folders</span>\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> folder <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> pst.root_folders:\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Iterate through the messages in the folder</span>\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> message <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> folder.sub_messages:\\\n            eml_file_name = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">f&quot;<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">{modify_subject_encoding(message.subject)}</span>.eml&quot;</span>\\\n            eml_file_path = os.path.join(output_dir, eml_file_name)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Parse the email message</span>\\\n            msg = BytesParser(policy=policy.default).parsebytes(message.mime_content)\\\n            msg.replace_header(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'Content-Transfer-Encoding'</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'quoted-printable'</span>)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Convert the email content to UTF-8 encoding</span>\\\n            msg_text = msg.as_bytes().decode(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'big5'</span>, errors=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'replace'</span>).encode(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'utf-8'</span>)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Save the email as EML file with UTF-8 encoding</span>\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">with</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(eml_file_path, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'wb'</span>) <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> eml_file:\\\n                eml_file.write(msg_text)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Close the PST file</span>\\\n    pst.close()\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> __name__ == <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;__main__&quot;</span>:\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Specify the path to the PST file and the output directory</span>\\\n    pst_file_path = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'path/to/your.pst'</span>\\\n    output_dir = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'path/to/output/directory'</span>\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Create the output directory if it doesn't exist</span>\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">not</span> os.path.exists(output_dir):\\\n        os.makedirs(output_dir)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Extract emails from PST, modify subject encoding, and save as EML with UTF-8 encoding</span>\\\n    extract_emails_from_pst(pst_file_path, output_dir)\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:0px;\\\">这个程序会尝试将邮件标题从 Big5 编码转换为 UTF-8 编码，并处理可能的异常字符。然后，它将邮件保存为 EML 文件，并使用 UTF-8 编码。请替换 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'path/to/your.pst'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 和 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>'path/to/output/directory'<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 为您的 PST 文件路径和 EML 文件希望保存的目录。</p></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;justify-content:space-between;display:block;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 88, 0);gap:4px;align-self:center;padding-left:8px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;gap:4px;\\\"></div></div></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;\\\"><img height=\\\"36\\\" src=\\\"https://s.gravatar.com/avatar/a258f20fcfeb877e2d761fd54f32ecbe?s=480&amp;r=pg&amp;d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fkh.png\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;height:auto;max-width:100%;border-radius:2px;color:transparent;\\\" width=\\\"36\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">我要一个立即可用的程序，输入部分是直接在命令行输入的 请帮我改写一下。</div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 32, 0);gap:4px;align-self:center;padding-left:8px;\\\"></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(247, 247, 248);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;height:36px;width:36px;align-items:center;justify-content:center;border-radius:2px;padding:4px;color:rgb(255, 255, 255);background-color:rgb(25, 195, 125);\\\"><img src=\\\"data:image/svg+xml,%3csvg width='41' height='41' viewBox='0 0 41 41' fill='none' xmlns='http://www.w3.org/2000/svg' class='icon-md js-evernote-checked' role='img' data-evernote-id='1423'%3e%3ctext x='-9999' y='-9999' data-evernote-id='1424' class='js-evernote-checked'%3eChatGPT%3c/text%3e%3cpath d='M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z' fill='currentColor' data-evernote-id='1425' class='js-evernote-checked'%3e%3c/path%3e%3c/svg%3e\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;stroke-width:1.5;height:20px;width:20px;\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(55, 65, 81);font-size:16px;line-height:1.75;width:100%;overflow-wrap:break-word;max-width:none;\\\"><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:0px;\\\">理解您的需求。以下是一个可以从命令行输入 PST 文件路径和输出目录的 Python 程序，用于将 PST 文件中的邮件转换为 EML 格式并修复标题编码的程序：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">python</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> os\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> argparse\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> libpff <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> file <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> libpff_file\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> policy\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email.parser <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> BytesParser\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">modify_subject_encoding</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">subject, source_encoding=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'big5'</span>, target_encoding=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'utf-8'</span></span>):\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">try</span>:\\\n        decoded_subject = subject.decode(source_encoding)\\\n        encoded_subject = decoded_subject.encode(target_encoding, errors=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'ignore'</span>)\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">return</span> encoded_subject\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">except</span> Exception <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> e:\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">print</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">f&quot;Error modifying subject: <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">{e}</span>&quot;</span>)\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">return</span> subject\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">extract_emails_from_pst</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">pst_file_path, output_dir</span>):\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Open the PST file</span>\\\n    pst = libpff_file()\\\n    pst.<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(pst_file_path)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Iterate through the folders</span>\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> folder <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> pst.root_folders:\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Iterate through the messages in the folder</span>\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> message <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> folder.sub_messages:\\\n            eml_file_name = <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">f&quot;<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">{modify_subject_encoding(message.subject)}</span>.eml&quot;</span>\\\n            eml_file_path = os.path.join(output_dir, eml_file_name)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Parse the email message</span>\\\n            msg = BytesParser(policy=policy.default).parsebytes(message.mime_content)\\\n            msg.replace_header(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'Content-Transfer-Encoding'</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'quoted-printable'</span>)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Convert the email content to UTF-8 encoding</span>\\\n            msg_text = msg.as_bytes().decode(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'big5'</span>, errors=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'replace'</span>).encode(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'utf-8'</span>)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Save the email as EML file with UTF-8 encoding</span>\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">with</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(eml_file_path, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'wb'</span>) <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> eml_file:\\\n                eml_file.write(msg_text)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Close the PST file</span>\\\n    pst.close()\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">main</span>():\\\n    parser = argparse.ArgumentParser(description=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;Convert PST emails to EML format with corrected encoding.&quot;</span>)\\\n    parser.add_argument(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;pst_file_path&quot;</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">help</span>=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;Path to the PST file&quot;</span>)\\\n    parser.add_argument(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;output_dir&quot;</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">help</span>=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;Output directory for EML files&quot;</span>)\\\n    args = parser.parse_args()\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">not</span> os.path.exists(args.output_dir):\\\n        os.makedirs(args.output_dir)\\\n\\\n    extract_emails_from_pst(args.pst_file_path, args.output_dir)\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> __name__ == <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;__main__&quot;</span>:\\\n    main()\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">这个程序使用 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>argparse<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 模块来从命令行接收输入。您可以在命令行中运行程序，如下所示：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">lua</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span>python pst_to_eml.py <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">path</span>/to/your.pst <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">path</span>/to/<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">output</span>/directory\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:0px;\\\">请将 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>&quot;path/to/your.pst&quot;<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 替换为您的 PST 文件路径，<code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>&quot;path/to/output/directory&quot;<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 替换为希望保存 EML 文件的目录。这个程序将 PST 文件中的邮件转换为 EML 格式，并尝试修复标题编码。</p></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;justify-content:space-between;display:block;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 88, 0);gap:4px;align-self:center;padding-left:8px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;gap:4px;\\\"></div></div></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;\\\"><img height=\\\"36\\\" src=\\\"https://s.gravatar.com/avatar/a258f20fcfeb877e2d761fd54f32ecbe?s=480&amp;r=pg&amp;d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fkh.png\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;height:auto;max-width:100%;border-radius:2px;color:transparent;\\\" width=\\\"36\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">跟前面的描述一样，但这次不是邮件的subject乱码，而是Windows中的档名乱码，请根据这个要求撰写一个python程序，一样是要能够直接执行的。</div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 32, 0);gap:4px;align-self:center;padding-left:8px;\\\"></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(247, 247, 248);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;height:36px;width:36px;align-items:center;justify-content:center;border-radius:2px;padding:4px;color:rgb(255, 255, 255);background-color:rgb(25, 195, 125);\\\"><img src=\\\"data:image/svg+xml,%3csvg width='41' height='41' viewBox='0 0 41 41' fill='none' xmlns='http://www.w3.org/2000/svg' class='icon-md js-evernote-checked' role='img' data-evernote-id='1575'%3e%3ctext x='-9999' y='-9999' data-evernote-id='1576' class='js-evernote-checked'%3eChatGPT%3c/text%3e%3cpath d='M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z' fill='currentColor' data-evernote-id='1577' class='js-evernote-checked'%3e%3c/path%3e%3c/svg%3e\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;stroke-width:1.5;height:20px;width:20px;\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(55, 65, 81);font-size:16px;line-height:1.75;width:100%;overflow-wrap:break-word;max-width:none;\\\"><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:0px;\\\">如果您的 PST 文件包含了文件附件，并且文件附件的文件名出现了乱码，您可以使用以下 Python 程序来解决这个问题。这个程序会将文件附件从 PST 文件中提取出来，并将文件名进行编码转换以修复乱码。</p><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">首先，确保您已经安装了 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>libpff<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 库。</p><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">然后，创建一个 Python 程序，如下所示：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">python</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> os\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> argparse\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> libpff <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> file <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> libpff_file\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email.parser <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> BytesParser\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email.header <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> decode_header\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">extract_attachments_from_pst</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">pst_file_path, output_dir</span>):\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Open the PST file</span>\\\n    pst = libpff_file()\\\n    pst.<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(pst_file_path)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Iterate through the folders</span>\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> folder <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> pst.root_folders:\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Iterate through the messages in the folder</span>\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> message <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> folder.sub_messages:\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Create a directory for each message</span>\\\n            message_dir = os.path.join(output_dir, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">f&quot;Message_<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">{message.message_id}</span>&quot;</span>)\\\n            os.makedirs(message_dir, exist_ok=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">True</span>)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Parse the email message</span>\\\n            msg = BytesParser().parsebytes(message.mime_content)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Extract and save attachments with correct filenames</span>\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> part <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> msg.walk():\\\n                <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> part.get_filename():\\\n                    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Decode the attachment's filename</span>\\\n                    filename, encoding = decode_header(part.get_filename())[<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(223, 48, 121);\\\">0</span>]\\\n                    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> encoding <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">is</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">not</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">None</span>:\\\n                        filename = filename.decode(encoding)\\\n\\\n                    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Save the attachment with the corrected filename</span>\\\n                    attachment_path = os.path.join(message_dir, filename)\\\n                    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">with</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(attachment_path, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'wb'</span>) <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> attachment_file:\\\n                        attachment_file.write(part.get_payload(decode=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">True</span>))\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Close the PST file</span>\\\n    pst.close()\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">main</span>():\\\n    parser = argparse.ArgumentParser(description=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;Extract and correct filenames of attachments from a PST file.&quot;</span>)\\\n    parser.add_argument(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;pst_file_path&quot;</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">help</span>=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;Path to the PST file&quot;</span>)\\\n    parser.add_argument(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;output_dir&quot;</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">help</span>=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;Output directory for attachments&quot;</span>)\\\n    args = parser.parse_args()\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">not</span> os.path.exists(args.output_dir):\\\n        os.makedirs(args.output_dir)\\\n\\\n    extract_attachments_from_pst(args.pst_file_path, args.output_dir)\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> __name__ == <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;__main__&quot;</span>:\\\n    main()\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">这个程序会从 PST 文件中提取邮件附件，并将附件的文件名进行编码转换以修复乱码问题。您可以在命令行中运行程序，如下所示：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">bash</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span>python pst_attachments.py path/to/your.pst path/to/output/directory\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:0px;\\\">请将 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>&quot;path/to/your.pst&quot;<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 替换为您的 PST 文件路径，<code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>&quot;path/to/output/directory&quot;<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 替换为希望保存附件的目录。程序将提取和保存附件，并尝试修复附件文件名的编码。</p></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;justify-content:space-between;display:block;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 88, 0);gap:4px;align-self:center;padding-left:8px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;gap:4px;\\\"></div></div></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;\\\"><img height=\\\"36\\\" src=\\\"https://s.gravatar.com/avatar/a258f20fcfeb877e2d761fd54f32ecbe?s=480&amp;r=pg&amp;d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fkh.png\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;height:auto;max-width:100%;border-radius:2px;color:transparent;\\\" width=\\\"36\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">我说的不是pst中的附件档名乱码，而是就是单纯的档案乱码</div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 32, 0);gap:4px;align-self:center;padding-left:8px;\\\"></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;width:100%;border-bottom-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(247, 247, 248);color:rgb(52, 53, 65);--avatar-color:#19c37d;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:auto;justify-content:center;padding:24px;font-size:16px;line-height:24px;gap:24px;padding-bottom:24px;padding-top:24px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:auto;margin-right:auto;display:flex;flex:1 1 0%;font-size:16px;line-height:24px;gap:24px;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-shrink:0;flex-direction:column;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;height:36px;width:36px;align-items:center;justify-content:center;border-radius:2px;padding:4px;color:rgb(255, 255, 255);background-color:rgb(25, 195, 125);\\\"><img src=\\\"data:image/svg+xml,%3csvg width='41' height='41' viewBox='0 0 41 41' fill='none' xmlns='http://www.w3.org/2000/svg' class='icon-md js-evernote-checked' role='img' data-evernote-id='1719'%3e%3ctext x='-9999' y='-9999' data-evernote-id='1720' class='js-evernote-checked'%3eChatGPT%3c/text%3e%3cpath d='M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z' fill='currentColor' data-evernote-id='1721' class='js-evernote-checked'%3e%3c/path%3e%3c/svg%3e\\\" style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:block;vertical-align:middle;stroke-width:1.5;height:20px;width:20px;\\\"></img></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin-left:-1rem;transform:matrix(1, 0, 0, 1, -52, 0);visibility:hidden;position:absolute;left:0px;top:8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;flex-grow:1;font-variant-numeric:tabular-nums;\\\">1 / 1</span></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:calc(100% - 115px);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;max-width:100%;flex-grow:1;flex-direction:column;gap:12px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;gap:12px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:break-word;min-height:20px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(55, 65, 81);font-size:16px;line-height:1.75;width:100%;overflow-wrap:break-word;max-width:none;\\\"><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:0px;\\\">如果您的 PST 文件中包含文件附件的文件名出现乱码，您可以使用以下 Python 程序来解决这个问题。这个程序会从 PST 文件中提取文件附件，并将文件名进行编码转换以修复乱码。</p><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">首先，确保您已经安装了 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>libpff<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 库。</p><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">然后，创建一个 Python 程序，如下所示：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">python</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> os\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> argparse\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> libpff <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> file <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> libpff_file\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">from</span> email.parser <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">import</span> BytesParser\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">extract_attachments_from_pst</span>(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">pst_file_path, output_dir</span>):\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Open the PST file</span>\\\n    pst = libpff_file()\\\n    pst.<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(pst_file_path)\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Iterate through the folders</span>\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> folder <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> pst.root_folders:\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Iterate through the messages in the folder</span>\\\n        <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> message <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> folder.sub_messages:\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Create a directory for each message</span>\\\n            message_dir = os.path.join(output_dir, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">f&quot;Message_<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">{message.message_id}</span>&quot;</span>)\\\n            os.makedirs(message_dir, exist_ok=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">True</span>)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Parse the email message</span>\\\n            msg = BytesParser().parsebytes(message.mime_content)\\\n\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Extract and save attachments with correct filenames</span>\\\n            <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">for</span> part <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">in</span> msg.walk():\\\n                <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> part.get_filename():\\\n                    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Get the attachment's filename</span>\\\n                    filename = part.get_filename()\\\n\\\n                    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Save the attachment with the original filename</span>\\\n                    attachment_path = os.path.join(message_dir, filename)\\\n                    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">with</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">open</span>(attachment_path, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">'wb'</span>) <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">as</span> attachment_file:\\\n                        attachment_file.write(part.get_payload(decode=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">True</span>))\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgba(255, 255, 255, 0.5);\\\"># Close the PST file</span>\\\n    pst.close()\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">def</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(242, 44, 61);\\\">main</span>():\\\n    parser = argparse.ArgumentParser(description=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;Extract attachments from a PST file.&quot;</span>)\\\n    parser.add_argument(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;pst_file_path&quot;</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">help</span>=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;Path to the PST file&quot;</span>)\\\n    parser.add_argument(<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;output_dir&quot;</span>, <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(233, 149, 12);\\\">help</span>=<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;Output directory for attachments&quot;</span>)\\\n    args = parser.parse_args()\\\n\\\n    <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">not</span> os.path.exists(args.output_dir):\\\n        os.makedirs(args.output_dir)\\\n\\\n    extract_attachments_from_pst(args.pst_file_path, args.output_dir)\\\n\\\n<span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(46, 149, 211);\\\">if</span> __name__ == <span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;color:rgb(0, 166, 125);\\\">&quot;__main__&quot;</span>:\\\n    main()\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-bottom:1.25em;margin-top:1.25em;\\\">这个程序会从 PST 文件中提取文件附件，并将附件的文件名保持为原始文件名。您可以在命令行中运行程序，如下所示：</p><pre style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;background-color:transparent;border-radius:6px;color:currentcolor;font-weight:400;line-height:1.71429;overflow-x:auto;padding:0px;font-size:0.875em;margin:0px;font-family:&quot;Söhne Mono&quot;, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;border-radius:6px;background-color:rgb(0, 0, 0);\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:space-between;border-top-left-radius:6px;border-top-right-radius:6px;background-color:rgb(52, 53, 65);padding-left:16px;padding-right:16px;padding-bottom:8px;padding-top:8px;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:12px;line-height:16px;color:rgb(217, 217, 227);\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">bash</span></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;overflow-y:auto;padding:16px;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span>python pst_attachments.py path/to/your.pst path/to/output/directory\\\n<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:inherit;color:inherit;font-weight:inherit;line-height:inherit;white-space:pre;text-align:left;word-spacing:normal;\\\"></span></code></div></div></pre><p style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;margin:0px;margin-top:1.25em;margin-bottom:0px;\\\">请将 <code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>&quot;path/to/your.pst&quot;<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 替换为您的 PST 文件路径，<code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span>&quot;path/to/output/directory&quot;<span style=\\\"font-family:Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace;font-size:0.875em;color:rgb(17, 24, 39);font-weight:600;\\\">`</span></code> 替换为希望保存附件的目录。程序将提取和保存附件，并保持附件文件名不变。如果文件名在 PST 文件中已经是乱码，那么您可能需要手动修复文件名。</p></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;justify-content:space-between;display:block;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;visibility:visible;display:flex;justify-content:center;color:rgb(172, 172, 190);position:absolute;right:0px;top:0px;margin-top:0px;transform:matrix(1, 0, 0, 1, 88, 0);gap:4px;align-self:center;padding-left:8px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;gap:4px;\\\"></div></div></div></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-shrink:0;height:192px;\\\"></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:absolute;bottom:0px;left:0px;border-top-width:0px;border-color:transparent;background-image:linear-gradient(rgba(255, 255, 255, 0) 13.94%, rgb(255, 255, 255) 54.73%);padding-left:8px;padding-top:0px;width:calc(100% - 0.5rem);background-color:transparent;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:row;gap:12px;margin-left:auto;margin-right:auto;max-width:768px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;height:100%;flex:1 1 0%;align-items:stretch;flex-direction:column;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;height:100%;justify-content:center;margin:auto;margin-bottom:16px;width:100%;gap:8px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;flex-grow:1;\\\"></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;align-items:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;opacity:1;\\\"></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;width:100%;align-items:center;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;display:flex;width:100%;flex-grow:1;flex-direction:column;overflow:hidden;border-radius:12px;border-width:1px;border-color:rgba(0, 0, 0, 0.1);background-color:rgb(255, 255, 255);box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.1) 0px 0px 15px 0px;\\\"></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:row;align-items:center;justify-content:flex-end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;margin-left:4px;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;width:100%;align-items:center;gap:8px;padding-bottom:8px;padding-top:8px;flex-direction:row;justify-content:end;\\\"><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:4px;\\\"></div></div><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;font-size:12px;line-height:16px;color:rgb(86, 88, 105);\\\">10000 chars</span></div></div></div></div></div><div style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;position:relative;padding-bottom:8px;padding-top:8px;text-align:center;font-size:12px;line-height:16px;color:rgb(86, 88, 105);padding-left:60px;padding-right:60px;\\\"><span style=\\\"border:0px solid rgb(217, 217, 227);box-sizing:border-box;\\\">ChatGPT can make mistakes. Consider checking important information.</span></div></div></div></span></div></div></div></div></div></div>\\\n</div>\\\n</span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":285073}]"
metadata_diff: {"new":{"id":"47d87ec0e4b74f6d8dd93228024cb40d","parent_id":"061de1401cfc4cfaadf6e74e015970e9","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764345753180,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T16:12:54.549Z
created_time: 2025-11-28T16:12:54.549Z
type_: 13