mikitex70 / plantuml-markdown

PlantUML plugin for Python-Markdown
BSD 2-Clause "Simplified" License
192 stars 55 forks source link

garbled code in image #40

Closed PifuYangPeter closed 4 years ago

PifuYangPeter commented 4 years ago

When the plug-in is used to draw a picture, when non English appears in the plantuml picture, it will display garbled code. like this:

@startuml
(测试) -> (结果)
@enduml
mikitex70 commented 4 years ago

I'm unable to reproduce the issue: for me it works fine. Example (adapted from your example, saved as an UTF-8 encoded file):

# Title

text before diagram

```uml

(测试) -> (结果)

text after diagram

is rendered to:
![non-ascii-characters](https://user-images.githubusercontent.com/2070527/72661759-9e533e80-39de-11ea-8515-53e8c53198d9.png)

Saving files as UTF-8 encoded is important: almost all systems now use this encoding and helps in compatibility.

Rendering is done by the PlantUML binary (Java) so first verify if plantuml works fine. For example, if `test.md` contains your diagram then executing:

plantuml -tpng test.md


should produce the `test.png` file with the rendered diagram. If it isn't correctly rendered, fix it (maybe there are missing Java or system fonts, try to search in the [PlantUML forum](https://forum.plantuml.net/)).

If instead the image is fine... then I need more to be able to help you, such as:

* kind of operating system (Windows/Mac/Linux); if Linux, which flavor (Debian, CentOS, ecc.)
* python version
mikitex70 commented 4 years ago

No more feedback, issue closed. Feel free to reopen it if you think this is the case.