closed eps:text special characters

0 votes
asked Apr 8 in Bug by PlantUML_User_Max (150 points)
closed Apr 12 by PlantUML_User_Max

Hello,

when I export the following diagram to eps with the text option (plantuml -eps:text) some German umlaut and characters are wrong. The preview and normal eps export renders it correct.

@startuml test
(äöü ÄÖÜ ß)
@enduml

I use the version PlantUML version 1.2019.05beta10

closed with the note: Not a bug, plantuml works correct. Probably an issue at my system.

1 Answer

0 votes
answered Apr 8 by Serge Wenger Work (11,040 points)

Hello, you must set the charset with:

-charset UTF-8 

commented Apr 8 by PlantUML_User_Max (150 points)
Sadly not, but the output changend slightly. Please have a look at the following minimal example:
First it shows the used version of PlantUML and graphviz, then fills a fresh file with UTF-8 content and tries to render it.
In the rweps-output there is the line (\344\366\374aoui \304O\334 \337) for the displayed text. But it should be (äöüaoui ÄOÜ ß) or am I wrong?

Maybe there is a problem with my eps-viewer too. For testing purposes I use IrfanView. Which program do you use? I googled a bit and found some problems with eps and special characters. For now I can use the option eps without ":text", but I would like to report the problem.

PS C:\> java -jar $plantjar -version
PlantUML version 1.2019.05beta10 (Unknown compile time)
(GPL source distribution)
Java Runtime: Java(TM) SE Runtime Environment
JVM: Java HotSpot(TM) 64-Bit Server VM
Java Version: 10+46
Operating System: Windows 10
OS Version: 10.0
Default Encoding: Cp1252
Language: en
Country: US
Machine: NB-X1G2
PLANTUML_LIMIT_SIZE: 4096
Processors: 4
Max Memory: 4,244,635,648
Total Memory: 266,338,304
Free Memory: 259,732,560
Used Memory: 6,605,744
Thread Active Count: 1

The environment variable GRAPHVIZ_DOT has not been set
Dot executable is c:\Program Files (x86)\Graphviz2.38\bin\dot.exe
Dot version: dot - graphviz version 2.38.0 (20140413.2041)
Installation seems OK. File generation OK
PS C:\> @"
>> @startuml test
>> (äöüaoui ÄOÜ ß)
>> @enduml
>> "@ | Set-Content $inFile -Encoding UTF8
PS C:\> Get-Content $inFile -Encoding UTF8
@startuml test
(äöüaoui ÄOÜ ß)
@enduml
PS C:\> java -jar $plantjar -charset UTF-8 -eps:text -i $inFile.FullName -o ..\out\
PS C:\> Get-Content $outFile
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: PlantUML v1.2019.05beta10
%%Title: noTitle
%%BoundingBox: 0 0 147 44
%%ColorUsage: Color
%%Origin: 0 0
%%EndComments

gsave
0 44 translate
.01 -.01 scale
/rquadto {
3 index 3 index 4 2 roll rcurveto
} def
gsave
1 0.235 scale
0.78 0.78 0.78 setrgbcolor
newpath
7750 11530 6850 0 360 arc
closepath eofill
grestore
gsave
1 0.2294 scale
0.69 0.69 0.69 setrgbcolor
newpath
7750 11812 6800 0 360 arc
closepath eofill
grestore
gsave
1 0.2237 scale
0.59 0.59 0.59 setrgbcolor
newpath
7750 12114 6750 0 360 arc
closepath eofill
grestore
gsave
1 0.2179 scale
0.49 0.49 0.49 setrgbcolor
newpath
7750 12436 6700 0 360 arc
closepath eofill
grestore
gsave
1 0.212 scale
0.39 0.39 0.39 setrgbcolor
newpath
7750 12781 6650 0 360 arc
closepath eofill
grestore
gsave
1 0.2061 scale
0.29 0.29 0.29 setrgbcolor
newpath
7750 13151 6600 0 360 arc
closepath eofill
grestore
gsave
1 0.2 scale
0.2 0.2 0.2 setrgbcolor
newpath
7750 13550 6550 0 360 arc
closepath eofill
grestore
gsave
1 0.235 scale
1 1 0.81 setrgbcolor
newpath
7450 10253 6850 0 360 arc
closepath eofill
150 setlinewidth
0.66 0 0.21 setrgbcolor
newpath
7450 10253 6850 0 360 arc
closepath stroke
grestore
2600 2840 moveto
0 0 0 setrgbcolor
/SansSerif.plain findfont 14 scalefont setfont
100 -100 scale
(\344\366\374aoui \304O\334 \337) show
.01 -.01 scale
grestore
showpage
%plantuml done
%%EOF
commented Apr 8 by Serge Wenger Work (11,040 points)
Hello,

I use the same version , but with -teps, not -eps:text.

%!PS-Adobe-3.0 EPSF-3.0
%%Creator: PlantUML v1.2019.05beta10
%%Title: noTitle
%%BoundingBox: 0 0 114 42
%%ColorUsage: Color
%%Origin: 0 0
%%EndComments

gsave
0 42 translate
.01 -.01 scale
/rquadto {
3 index 3 index 4 2 roll rcurveto
} def
/P$3 {
0 -139 rlineto
128 0 rlineto
0 139 rlineto
-128 0 rlineto
} def
/P$0 {
-67 57 -130 82 rquadto
-63 24 -136 24 rquadto
-118 0 -183 -58 rquadto
-64 -58 -64 -150 rquadto
0 -53 24 -96 rquadto
24 -43 64 -70 rquadto
39 -26 88 -40 rquadto
35 -9 109 -18 rquadto
150 -17 220 -42 rquadto
0 -25 0 -31 rquadto
0 -76 -34 -106 rquadto
-46 -42 -140 -42 rquadto
-85 0 -127 30 rquadto
-41 30 -61 107 rquadto
-120 -15 rlineto
15 -78 53 -125 rquadto
38 -46 109 -72 rquadto
71 -25 164 -25 rquadto
92 0 150 21 rquadto
57 21 85 54 rquadto
27 32 38 84 rquadto
6 31 6 112 rquadto
0 164 rlineto
0 171 7 217 rquadto
7 45 31 87 rquadto
-128 0 rlineto
-18 -39 -25 -89 rquadto
closepath
} def
/P$c {
0 -682 rlineto
0 -125 30 -192 rquadto
30 -67 101 -105 rquadto
71 -38 160 -38 rquadto
117 0 185 58 rquadto
67 58 67 136 rquadto
0 35 -12 72 rquadto
-12 36 -43 91 rquadto
-31 54 -39 76 rquadto
-7 21 -7 37 rquadto
0 21 14 43 rquadto
14 21 82 65 rquadto
93 60 123 98 rquadto
43 53 43 123 rquadto
0 95 -69 163 rquadto
-69 67 -178 67 rquadto
-85 0 -151 -46 rquadto
-65 -46 -96 -119 rquadto
106 -48 rlineto
34 64 67 88 rquadto
33 24 71 24 rquadto
53 0 89 -35 rquadto
36 -35 36 -83 rquadto
0 -37 -21 -65 rquadto
-14 -17 -76 -59 rquadto
-114 -78 -140 -117 rquadto
-26 -39 -26 -79 rquadto
0 -28 8 -55 rquadto
8 -27 44 -87 rquadto
35 -60 46 -89 rquadto
10 -29 10 -53 rquadto
0 -42 -37 -75 rquadto
-37 -32 -100 -32 rquadto
-73 0 -119 45 rquadto
-46 45 -46 195 rquadto
0 678 rlineto
-123 0 rlineto
closepath
} def
/P$4 {
0 -201 112 -300 rquadto
92 -79 228 -79 rquadto
148 0 243 97 rquadto
95 97 95 271 rquadto
0 140 -42 221 rquadto
-42 80 -122 125 rquadto
-80 44 -174 44 rquadto
-153 0 -246 -98 rquadto
-93 -98 -93 -281 rquadto
closepath
} def
/P$8 {
339 0 rlineto
-104 -278 rlineto
-46 -126 -70 -207 rquadto
-18 96 -54 190 rquadto
-109 295 rlineto
closepath
} def
/P$1 {
-67 26 -201 46 rquadto
-75 10 -107 24 rquadto
-32 13 -49 39 rquadto
-17 26 -17 57 rquadto
0 50 37 82 rquadto
37 32 109 32 rquadto
71 0 126 -31 rquadto
54 -31 81 -85 rquadto
20 -40 20 -121 rquadto
0 -45 rlineto
closepath
} def
/P$7 {
384 -1001 rlineto
142 0 rlineto
410 1001 rlineto
-151 0 rlineto
-117 -303 rlineto
-418 0 rlineto
-109 303 rlineto
-140 0 rlineto
closepath
} def
/P$2 {
0 -139 rlineto
128 0 rlineto
0 139 rlineto
-128 0 rlineto
closepath
} def
/P$a {
0 181 97 285 rquadto
97 103 244 103 rquadto
148 0 245 -104 rquadto
96 -104 96 -298 rquadto
0 -123 -41 -214 rquadto
-41 -90 -121 -141 rquadto
-79 -50 -178 -50 rquadto
-140 0 -242 96 rquadto
-101 96 -101 323 rquadto
closepath
} def
/P$9 {
0 -250 134 -391 rquadto
134 -141 345 -141 rquadto
139 0 250 66 rquadto
111 66 170 185 rquadto
58 118 58 268 rquadto
0 153 -61 273 rquadto
-61 120 -174 182 rquadto
-112 61 -243 61 rquadto
-142 0 -253 -68 rquadto
-110 -68 -168 -186 rquadto
-57 -117 -57 -249 rquadto
closepath
} def
/P$5 {
0 139 60 208 rquadto
60 69 153 69 rquadto
90 0 151 -70 rquadto
60 -70 60 -212 rquadto
0 -134 -60 -203 rquadto
-60 -69 -151 -69 rquadto
-92 0 -153 68 rquadto
-60 68 -60 209 rquadto
closepath
} def
/P$6 {
0 -106 rlineto
-85 123 -231 123 rquadto
-64 0 -119 -25 rquadto
-55 -25 -82 -62 rquadto
-27 -37 -38 -90 rquadto
-7 -35 -7 -115 rquadto
0 -450 rlineto
123 0 rlineto
0 403 rlineto
0 96 7 129 rquadto
10 48 48 76 rquadto
37 28 93 28 rquadto
54 0 103 -28 rquadto
48 -28 68 -77 rquadto
20 -48 20 -142 rquadto
0 -389 rlineto
123 0 rlineto
0 726 rlineto
-109 0 rlineto
closepath
} def
/P$b {
132 0 rlineto
0 578 rlineto
0 151 -34 240 rquadto
-34 89 -123 144 rquadto
-89 55 -234 55 rquadto
-140 0 -230 -48 rquadto
-89 -48 -128 -140 rquadto
-38 -92 -38 -251 rquadto
0 -578 rlineto
132 0 rlineto
0 578 rlineto
0 129 24 191 rquadto
24 61 83 95 rquadto
59 33 145 33 rquadto
145 0 207 -66 rquadto
62 -66 62 -253 rquadto
0 -578 rlineto
closepath
} def
gsave
1 0.2943 scale
0.78 0.78 0.78 setrgbcolor
newpath
6149 8987 5249 0 360 arc
closepath eofill
grestore
gsave
1 0.2875 scale
0.69 0.69 0.69 setrgbcolor
newpath
6149 9199 5199 0 360 arc
closepath eofill
grestore
gsave
1 0.2806 scale
0.59 0.59 0.59 setrgbcolor
newpath
6149 9425 5149 0 360 arc
closepath eofill
grestore
gsave
1 0.2736 scale
0.49 0.49 0.49 setrgbcolor
newpath
6149 9668 5099 0 360 arc
closepath eofill
grestore
gsave
1 0.2664 scale
0.39 0.39 0.39 setrgbcolor
newpath
6149 9929 5049 0 360 arc
closepath eofill
grestore
gsave
1 0.259 scale
0.29 0.29 0.29 setrgbcolor
newpath
6149 10211 4999 0 360 arc
closepath eofill
grestore
gsave
1 0.2516 scale
0.2 0.2 0.2 setrgbcolor
newpath
6149 10514 4949 0 360 arc
closepath eofill
grestore
gsave
1 0.2943 scale
1 1 0.81 setrgbcolor
newpath
5849 7967 5249 0 360 arc
closepath eofill
150 setlinewidth
0.66 0 0.21 setrgbcolor
newpath
5849 7967 5249 0 360 arc
closepath stroke
grestore
0 setlinewidth
[] 0 setdash
0 0 0 setrgbcolor
newpath
2915 2786 moveto
P$0
2905 2511 moveto
P$1
2595 1975 moveto
P$2
2849 1975 moveto
P$3
fill
0 setlinewidth
[] 0 setdash
0 0 0 setrgbcolor
newpath
3196 2513 moveto
P$4
3323 2513 moveto
P$5
3395 1975 moveto
P$2
3649 1975 moveto
P$3
fill
0 setlinewidth
[] 0 setdash
0 0 0 setrgbcolor
newpath
4518 2875 moveto
P$6
4191 1975 moveto
P$2
4446 1975 moveto
P$3
fill
0 setlinewidth
[] 0 setdash
0 0 0 setrgbcolor
newpath
5148 2875 moveto
P$7
5437 2464 moveto
P$8
5395 1775 moveto
P$2
5649 1775 moveto
P$3
fill
0 setlinewidth
[] 0 setdash
0 0 0 setrgbcolor
newpath
6116 2388 moveto
P$9
6254 2389 moveto
P$a
6395 1775 moveto
P$2
6649 1775 moveto
P$3
fill
0 setlinewidth
[] 0 setdash
0 0 0 setrgbcolor
newpath
7915 1874 moveto
P$b
7491 1775 moveto
P$2
7746 1775 moveto
P$3
fill
0 setlinewidth
[] 0 setdash
0 0 0 setrgbcolor
newpath
8554 2875 moveto
P$c
fill
grestore
showpage
%plantuml done
%%EOF
commented Apr 8 by PlantUML_User_Max (150 points)
Well... it works fine. But the embedded text is not selectable. I used the option ":text" for that (see http://forum.plantuml.net/3214/selectable-searchable-%26-copyable-text-in-eps-output ).
commented Apr 11 by plantuml (198,400 points)
Back to eps:text, it looks like an issue of your eps rendering program.
\344 corresponds to the octal encoding of ä (see https://www-k12.atmos.washington.edu/~ovens/gmt/doc/html/GMT_Docs/node153.html for example).
Maybe you can try to manually edit your eps file and change \344 (and other) to ä and save the result as UTF8.
If it works for you this way, we might add yet-another-option (like eps:text:utf8) that would use UTF8 encoding instead of octal. Just tell us...
commented Apr 12 by PlantUML_User_Max (150 points)
Thanks for your answers (@Serge Wenger Work and plantuml).

Sorry for my bug report, it seems that you are correct with \344, but it doesn't work for me (probably due to an issue of my system setting).
I tried to manually edit the file(s), set the encodings, and so on with various values.

I give up and do not use the ':text'-option anymore, maybe I should choose a other format too...
...