解决wordpress中使用plantuml插件不识别中文

修改插件代码

plantuml-renderer/public/class-plantuml-renderer-public.php

private function encodep( $text ) {
    //$data = utf8_encode( $text );  //这行注释
    $data=$text;                     //改成这个,text变量本身是utf8编码了,所以不需要转了
    $compressed = gzdeflate( $data, 9 );
    return $this->encode64( $compressed );
}

 

PlantUML Syntax:</p>
<p>@startuml</p>
<p>:嘿嘿我是多出来的中文角色:<br />
:Main Admin: as Admin<br />
(Use the application) as (Use)</p>
<p>User -> (Start)<br />
User –> (Use)</p>
<p>Admin —> (Use)</p>
<p>note right of Admin : This is an example.</p>
<p>note right of (Use)<br />
A note can also<br />
be on several lines<br />
end note</p>
<p>note “This note is connected\nto several objects.” as N2<br />
(Start) .. N2<br />
N2 .. (Use)<br />
@enduml</p>
<p>

发表评论

电子邮件地址不会被公开。