UTF-8 doesn't render properly

+1 vote
asked Nov 13, 2013 in To be sorted by anonymous
edited Nov 13, 2013
"plantuml -help" says: -charset xxx To use a specific charset (default is UTF-8) But using UTF-8 characters (like ø) in my diagrams renders as ?? or even fails to generate at all. EDIT: Seems adding "-charset UTF-8" fixes the issue even though the default says it is already set..
commented Mar 2, 2015 by anonymous
edited Mar 2, 2015
UML content

 name = "Krauß"

ends up in svg as:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="85" x="762" y="76.1958">name = "Krau�"</text>

when called with:
java -jar plantuml.jar -tsvg -charset UTF-8 -o ...

in PHP extension.

PlantUML version 8018 (Wed Jan 14 18:42:18 CET 2015)
(GPL source distribution)
Java(TM) SE Runtime Environment
Java HotSpot(TM) 64-Bit Server VM

The environment variable GRAPHVIZ_DOT has not been set
Dot executable is /usr/bin/dot
Dot version: dot - graphviz version 2.26.3 (20100126.1600)
Installation seems OK. File generation OK

The issue is the used utf8_decode which converts to ISO8859. Removing that function will make the behaviour proper.
  $string  = "@startuml\n";
    // Allow ditaa and graphviz first-line directives and accents (french, ..)
    // $string .= preg_replace("/^\r?\n/", "", utf8_decode($PlantUML_Source), 1) . "\n";
commented Mar 2, 2015 by plantuml (265,360 points)
Thanks for your investigation. However, where does the code you are removing come from ? It does not seem to be ours.
commented Mar 3, 2015 by anonymous
 * Copyright (C) 2010 Arnoud Roques
 * Copyright (C) 2011 Pieter J. Kersten
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

$version = "0.5";
commented Mar 3, 2015 by plantuml (265,360 points)
Ok, it looks like we are talking about the MediaWiki plugin hosted here:

We will send a mail to Pieter to see if he's ok with this changes.

Thanks again!

1 Answer

0 votes
answered May 28, 2014 by blochberger (200 points)
It's not rendering properly in GUI mode, too.
commented May 29, 2014 by blochberger (200 points)
Unless if you start the gui using:

  java -jar plantuml.jar -charset UTF-8 -gui

This will work just fine.