Unicode <U+005C> (backslash) in Tooltip-text causes error

0 votes
asked Sep 11 in Bug by Tjarko

In a tooltip [["..." TP]] I want to escape backslash (\) in order to prevent a linebreak from \n.
So I replaced \ by <U+005C>.

@startwbs
+ raw string literals \
 [["Example:\n\nconst char* msg1 = <U+0022><U+005C>nHello,world!<U+0022>;" TP]]
@endwbs

Above example works with the Online-Server, but my local plantuml (V1.2024.7) reports an error:

java.lang.IllegalArgumentException: character to be escaped is missing
java.util.regex.Matcher.appendReplacement(Unknown Source)

I start plantuml for producing svg: 
java -DPLANTUML_LIMIT_SIZE=16385 -jar Z:/Programme/plantuml.jar -gui -tsvg &

1 Answer

+1 vote
answered Sep 12 by The-Lu (70,400 points)

Hello T.,

Here is a workaround using a 'ZERO WIDTH SPACE (U+200B)' between `\` and `n`, as:

@startwbs
+ raw string literals \
 [["Example:\n\nconst char* msg1 = <U+0022>\<U+200B>nHello,world!<U+0022>;" TP]]
@endwbs

And SVG Link.

Enjoy,
Regards,
Th.

...