artifacthealth / typedoc-plantuml

Plugin for TypeDoc that generates images for PlantUML diagrams embedded in comments.
Apache License 2.0
15 stars 6 forks source link

UTF-8 encoding #4

Closed Chklang closed 8 years ago

Chklang commented 8 years ago

Hi

I'm french so i've many special caracters like "é", "à", etc... so my diagrams are in UTF-8 encoding. If i go to watch the "node-plantuml" plugin, function "generate", i can see :

module.exports.generate = function (input, options, callback) {

And these options are directly given to java command. So i must give "-charset UTF-8" to "options" parameter.

If i watch your code, in "writeLocalImage()" function, you call generate without any option :

var gen = plantuml.generate({format: format});

Can you add options to your plugin to give some parameters to plantuml converter?

Regards.

meirgottlieb commented 8 years ago

The issue was in the plantuml-encoder module I was using. It had this line that was causing the problem:

var utf8 = unescape(encodeURIComponent(text))

They do the same thing in the Plantuml Javascript example source code. Anyways, I removed the dependency on that module and just do the encoding myself without that line and the image generation with special characters now seems to work fine.