Problem with utf-8 in included file

0 votes
asked Feb 11, 2013 in Bug by mpantel (120 points)

Hi to everyone,

I have two files:
a.puml:
@startuml
class "Ελληνικά" as Aclass
@enduml

which produces correctly:
a

and b.puml which !includes a.puml:
@startuml
!include a.puml
@enduml

but incorrectly produces:
b

This happens using PlantUML plugin for InteliJ (RubyMine) and using OpenOffice plugin
but not when i render these files from the command line, running directly the .jar file.

Both files are save in UTF-8 encoding.

I verified that OpenOffice plugin appends the UTF-8 parameter to the resulting command
which also is not necessary on the command line for me to produce the correct output

Does anybody has an idea what i am doing wrong or is this a bug?

Thanks in advance

Michail

2 Answers

0 votes
answered Feb 12, 2013 by plantuml (298,440 points)
selected Feb 14, 2013 by mpantel
 
Best answer
This has been fixed in release 7957.

Regards,
commented Feb 12, 2013 by mpantel (120 points)
I still have the same problem from open office and rubymine...
but on the command line, i get correct results as before. All files are saved in UTF-8

Thank you for the replies.

Kind Regards,
Michail
commented Feb 12, 2013 by plantuml (298,440 points)
Are you sure that you are running 7957 from open office and rubymine? You should double check it using (from open office/rubymine) :
@startuml
version
@enduml
If you still have the issue, could you test using only one non-ASCII character (for example : é), and copy the image you get?
commented Feb 13, 2013 by mpantel (120 points)
I have:
a.puml:
@startuml
abstract class "é"
@enduml

which gives:
http://www.ru.aegean.gr/images/a1.png

and
b.puml:
@startuml
!include a.puml
@enduml

@startuml
version
@enduml

which gives:
http://www.ru.aegean.gr/images/b1.png

and
http://www.ru.aegean.gr/images/b2.png

still have the problem

Thanks

Michail
commented Feb 13, 2013 by plantuml (298,440 points)
Ok, here is a special debug version of PlantUML : http://dl.dropbox.com/u/13064071/plantuml.jar

Could you launch it with the following diagram:

@startuml
class é
note left
!include a.puml
end note
@enduml

Then publish the generated image.
I think we have found the issue, but we want to double check it.

Sorry for the remote debugging :-)
commented Feb 13, 2013 by mpantel (120 points)
I replaced my plantuml.jar with the new one and the proposed diagram gives me:
http://www.ru.aegean.gr/images/s.png
interestingly it gives me
http://www.ru.aegean.gr/images/s2.png , when i switch from java 1.7 to java 1.6

Well if remote debugging is some kind of way to contribute
it is ok with me!

Kind Regards,

Michail
commented Feb 13, 2013 by plantuml (298,440 points)
Something is strange : the two images you gave seem to have been generated with the regular version of PlantUML.
You should have something like : http://dl.dropbox.com/u/13064071/debug001.png
Could you reload this one : http://dl.dropbox.com/u/13064071/plantuml001.zip
Unzip the plantuml.jar file from there

Check with:
@startuml
version
@enduml

That your version is "special01"

Then launch it again with the following diagram:

@startuml
class é
note left
!include a.puml
end note
@enduml

Thanks,
commented Feb 13, 2013 by mpantel (120 points)
edited Feb 14, 2013 by mpantel
commented Feb 13, 2013 by plantuml (298,440 points)
edited Feb 13, 2013 by plantuml
No, I don't think you are doing something wrong.
Did you have the same result with InteliJ and OpenOffice ?
I've got the feeling that the !include directive is executed before that PlantUML is running.
I don't know how InteliJ plugin is working, but I think that OpenOffice plugin does not handle !include by himself.
So could you tell me which one are you using ? And which result do you get running command line ?
Thanks
commented Feb 14, 2013 by mpantel (120 points)
Well LibreOffice gives me:
http://www.ru.aegean.gr/images/e.pdf
and command line execution of "java -jar plantuml.jar c.puml":
where c.puml is:
----
@startuml
class é
note left
!include a.puml
end note
@enduml

@startuml
version
@enduml
-----
gives:
http://www.ru.aegean.gr/images/e1.png
http://www.ru.aegean.gr/images/e2.png

Informatively a.puml is:
----
@startuml
abstract class "é"
@enduml
----
and command line generation of this file produces:

http://www.ru.aegean.gr/images/e3.png

Unfortunatelly i am unable to run libreoffice with java 1.7

Kind Regards,

Michail
commented Feb 14, 2013 by plantuml (298,440 points)
Ok, I think we fix the problem!
Could you try this version and tell us ?
http://dl.dropbox.com/u/13064071/plantuml002.zip

BTW, you don't have to put @startuml/@enduml in the included file (a.puml).

(That's why it takes time to understand what was going on : in our test, the included file was not starting by @startuml, and in yours it was, so
the execution was lightly different)
commented Feb 14, 2013 by mpantel (120 points)
OK! fixed for LibreOffice:
http://www.ru.aegean.gr/images/f.pdf

But problem still exists for RubyMine. Strange...
http://www.ru.aegean.gr/images/f1.png
http://www.ru.aegean.gr/images/f2.png
even without @startuml/@enduml tags in the included files

Any Ideas?

In any case thanks a lot for the fix for libreoffice. It is very usefull in some documentation i am currently writing.

KInd Regards,

Michail!
commented Feb 14, 2013 by plantuml (298,440 points)
Great that we have something working for OpenOffice.

For RubyMine, first, I'd like to know which PlantUML plugin it is ? Do you have any URL about it ?
Anyway, as someone says, when you have excluded the impossible, whatever remains, however improbable, must be the truth.

So it's possible that this version will be working : https://dl.dropbox.com/u/13064071/plantuml003.zip

(It means that this unknown plugin is using SourceStringReader instead of command line).
commented Feb 14, 2013 by mpantel (120 points)
Yey it Works!

By the way i use this plugin (PlantUML integration) : http://plugins.jetbrains.com/plugin/?ruby&pluginId=7017

Thank you very much for your quick response. It was a fun debugging session!

Kind Regards,

Michail
0 votes
answered Feb 11, 2013 by plantuml (298,440 points)

Hi,

This seems to be a bug of PlantUML  : !include uses the natural/default charset of your plateform (which is not UTF8).

We will fix that a keep you informed about it.

Regards,

 

...