Skip to content

Unicode Encoding error #47

@10cheon00

Description

@10cheon00

Hello. I'm not used to writing issue, so maybe there are some ambiguity.

I was try to make sequence diagram using vscode extension. And I found your great extension and it is really useful.

But the problem occured when I save diagram into svg file. Result is this:

Image

You can see those strange symbols, because I wrote file with Korean!

The seqdiag file is:

사용자->Pemfc: Pemfc id 전달
Pemfc->Pemfc 데이터베이스: Pemfc id값으로 삭제 요청
Pemfc 데이터베이스-->Pemfc: 삭제 완료
Pemfc-->사용자: 삭제 완료

So I tried to fixed this problem in my workspace, and I found error in this line:

switch (e.command) {
  case "export-svg":
    (t = "svg"),
      (n = this._getExportFileName(t)),
      c.writeFileSync(
        n,
        Buffer.from(e.data, "base64").toString("binary")
        /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ */
      );
    break;

I found this code in .vscode-server\extensions\aleksandardev.vscode-sequence-diagrams-0.4.7/dist/extensions.js, not in your repository, so I'm sorry about that I can't show actual code. It is really hard to find for me. 😥

I fixed this issue with:

-         Buffer.from(e.data, "base64").toString("binary")
+         Buffer.from(e.data, "base64").toString("utf8")

Image

Thank you for reading this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions