Loading... <p style="margin-top:0px;margin-bottom:1.5em;padding:0px;border:0px;outline:0px;font-size:13.92px;color:#333333;font-family:"white-space:normal;background-color:#666666;"> 官方默认仍然是不支持,解决这个问题还是要自己手动修改一下源码,方法已在h5ai 官方github 的issue 140《<a href="https://github.com/lrsjng/h5ai/issues/140" target="_blank" style="margin:0px;padding:0px;border:0px;outline:0px;font-size:13.92px;text-decoration:none;color:#664422;">Support non UTF-8 encoded file systems</a>》 中提及,在这里简单分享一下。<br /> <span id="more-762" style="margin:0px;padding:0px;border:0px;outline:0px;font-size:13.92px;"></span> </p> <h3 style="margin:0.5em 0px;padding:0px;border:0px;outline:0px;font-size:23.1072px;color:#664422;line-height:1.1em;font-family:"white-space:normal;background-color:#666666;"> 让h5ai完美支持中文 </h3> <p style="margin-top:0px;margin-bottom:1.5em;padding:0px;border:0px;outline:0px;font-size:13.92px;color:#333333;font-family:"white-space:normal;background-color:#666666;"> 仅需修改<strong style="margin:0px;padding:0px;border:0px;outline:0px;font-size:13.92px;"><span style="color:#333333;font-family:"white-space:normal;background-color:#FFFFFF;font-size:13.92px;">class-context.php</span></strong> 这个文件就可以解决问题了。 </p> <p style="margin-top:0px;margin-bottom:1.5em;padding:0px;border:0px;outline:0px;font-size:13.92px;color:#333333;font-family:"white-space:normal;background-color:#666666;"> _h5ai\private\php\core\<span style="color:#333333;font-family:"white-space:normal;background-color:#FFFFFF;font-size:13.92px;">class-context.php</span> </p> <p style="margin-top:0px;margin-bottom:1.5em;padding:0px;border:0px;outline:0px;font-size:13.92px;color:#333333;font-family:"white-space:normal;background-color:#666666;"> 第84行 </p> <div class="wp_syntax" style="margin:0px 0px 1.5em;padding:0px;border:1px solid silver;outline:0px;font-size:13.92px;color:#110000;background-color:#F9F9F9;overflow-x:auto;overflow-y:hidden;width:615.766px;font-family:"white-space:normal;"> <table style="outline:0px;font-size:13.92px;width:615px;margin:0px !important;padding:0px !important;border:none !important;"> <tbody style="margin:0px;padding:0px;border:0px;outline:0px;font-size:13.92px;"> <tr style="margin:0px;padding:0px;border:0px;outline:0px;font-size:13.92px;"> <td class="code" style="margin:0px;padding:6px;border-bottom:1px dotted #664422;outline:0px;font-size:13.92px;background-color:#EEEEEE;background-image:linear-gradient(transparent 50%, rgba(255, 255, 255, 0.901961) 50%);background-size:1px 32px;width:615px;border-top:none !important;border-right:none !important;border-left:none !important;border-image:initial !important;vertical-align:top !important;line-height:normal !important;"> <pre class="php" style="outline:0px;margin-top:0px !important;margin-bottom:0px !important;padding:0px 4px !important;border:none !important;font-size:12px !important;overflow:visible !important;background:transparent !important;line-height:16px !important;border-radius:0px !important;width:auto !important;float:none !important;clear:none !important;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px !important;"><span style="margin:0px;padding:0px;border:0px;outline:0px;color:#000088;"> $encoded_parts[] = rawurlencode($part);</span><span style="margin:0px;padding:0px;border:0px;outline:0px;color:#339933;"></span></pre> </td> </tr> </tbody> </table> </div> <p style="margin-top:0px;margin-bottom:1.5em;padding:0px;border:0px;outline:0px;font-size:13.92px;color:#333333;font-family:"white-space:normal;background-color:#666666;"> 修改为: </p> <div class="wp_syntax" style="margin:0px 0px 1.5em;padding:0px;border:1px solid silver;outline:0px;font-size:13.92px;color:#110000;background-color:#F9F9F9;overflow-x:auto;overflow-y:hidden;width:615.766px;font-family:"white-space:normal;"> <table style="outline:0px;font-size:13.92px;width:615px;margin:0px !important;padding:0px !important;border:none !important;"> <tbody style="margin:0px;padding:0px;border:0px;outline:0px;font-size:13.92px;"> <tr style="margin:0px;padding:0px;border:0px;outline:0px;font-size:13.92px;"> <td class="code" style="margin:0px;padding:6px;border-bottom:1px dotted #664422;outline:0px;font-size:13.92px;background-color:#EEEEEE;background-image:linear-gradient(transparent 50%, rgba(255, 255, 255, 0.901961) 50%);background-size:1px 32px;width:615px;border-top:none !important;border-right:none !important;border-left:none !important;border-image:initial !important;vertical-align:top !important;line-height:normal !important;"> <pre class="php" style="outline:0px;margin-top:0px !important;margin-bottom:0px !important;padding:0px 4px !important;border:none !important;font-size:12px !important;overflow:visible !important;background:transparent !important;line-height:16px !important;border-radius:0px !important;width:auto !important;float:none !important;clear:none !important;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px !important;"><span style="margin:0px;padding:0px;border:0px;outline:0px;color:#000088;">$encoded_parts[] = rawurlencode(mb_convert_encoding($part, "UTF-8", "GBK"));</span><span style="margin:0px;padding:0px;border:0px;outline:0px;color:#339933;"></span></pre> </td> </tr> </tbody> </table> </div> <p style="margin-top:0px;margin-bottom:1.5em;padding:0px;border:0px;outline:0px;font-size:13.92px;color:#333333;font-family:"white-space:normal;background-color:#666666;"> 第94行 </p> <div class="wp_syntax" style="margin:0px 0px 1.5em;padding:0px;border:1px solid silver;outline:0px;font-size:13.92px;color:#110000;background-color:#F9F9F9;overflow-x:auto;overflow-y:hidden;width:615.766px;font-family:"white-space:normal;"> <table style="outline:0px;font-size:13.92px;width:615px;margin:0px !important;padding:0px !important;border:none !important;"> <tbody style="margin:0px;padding:0px;border:0px;outline:0px;font-size:13.92px;"> <tr style="margin:0px;padding:0px;border:0px;outline:0px;font-size:13.92px;"> <td class="code" style="margin:0px;padding:6px;border-bottom:1px dotted #664422;outline:0px;font-size:13.92px;background-color:#EEEEEE;background-image:linear-gradient(transparent 50%, rgba(255, 255, 255, 0.901961) 50%);background-size:1px 32px;width:615px;border-top:none !important;border-right:none !important;border-left:none !important;border-image:initial !important;vertical-align:top !important;line-height:normal !important;"> <pre class="php" style="outline:0px;margin-top:0px !important;margin-bottom:0px !important;padding:0px 4px !important;border:none !important;font-size:12px !important;overflow:visible !important;background:transparent !important;line-height:16px !important;border-radius:0px !important;width:auto !important;float:none !important;clear:none !important;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px !important;"><span style="margin:0px;padding:0px;border:0px;outline:0px;color:#000088;">return Util::normalize_path($this->setup->get('ROOT_PATH') . '/' . rawurldecode($rel_href));</span></pre> </td> </tr> </tbody> </table> </div> <p style="margin-top:0px;margin-bottom:1.5em;padding:0px;border:0px;outline:0px;font-size:13.92px;color:#333333;font-family:"white-space:normal;background-color:#666666;"> 修改为: </p> <div class="wp_syntax" style="margin:0px 0px 1.5em;padding:0px;border:1px solid silver;outline:0px;font-size:13.92px;color:#110000;background-color:#F9F9F9;overflow-x:auto;overflow-y:hidden;width:615.766px;font-family:"white-space:normal;"> <table style="outline:0px;font-size:13.92px;width:615px;margin:0px !important;padding:0px !important;border:none !important;"> <tbody style="margin:0px;padding:0px;border:0px;outline:0px;font-size:13.92px;"> <tr style="margin:0px;padding:0px;border:0px;outline:0px;font-size:13.92px;"> <td class="code" style="margin:0px;padding:6px;border-bottom:1px dotted #664422;outline:0px;font-size:13.92px;background-color:#EEEEEE;background-image:linear-gradient(transparent 50%, rgba(255, 255, 255, 0.901961) 50%);background-size:1px 32px;width:615px;border-top:none !important;border-right:none !important;border-left:none !important;border-image:initial !important;vertical-align:top !important;line-height:normal !important;"> <pre class="php" style="outline:0px;margin-top:0px !important;margin-bottom:0px !important;padding:0px 4px !important;border:none !important;font-size:12px !important;overflow:visible !important;background:transparent !important;line-height:16px !important;border-radius:0px !important;width:auto !important;float:none !important;clear:none !important;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px !important;"><span style="margin:0px;padding:0px;border:0px;outline:0px;color:#0000FF;">return Util::normalize_path($this->setup->get('ROOT_PATH') . '/' . mb_convert_encoding(rawurldecode($rel_href), "GBK", "UTF-8"));</span></pre> </td> </tr> </tbody> </table> </div> 最后修改:1970 年 01 月 01 日 © 允许规范转载 打赏 赞赏作者 赞 如果觉得我的文章对你有用,请随意赞赏
1 条评论
改完以后会出现空文件的情况,我找了半天终于知道是这个的问题。