Markup on GtkLabel gives spurious leading character

Viewed 24

I am using markup on a GtkLabel to set the foreground color but when I do, there is a spurious leading character. Does anyone know what is wrong here?

Here is what it looks like:

Screenshot of message with bad leading character

The code:

sMarkup = g_markup_printf_escaped(
    "<span color=\"darkred\">%s</span>", message->sMessage);
gtk_label_set_markup(wLabel, sMarkup);

This is gtk3 (3.24) under Fedora 36.

The added character is not in the message (I can substitute a fixed string and get the same result). Also, if I don't use <span> markup there is no bad leading character.

1 Answers

Never mind .... there was a non-visible character preceding the %s.

The Eclipse editor just didn't show it (should stick to vi 8-)

Related