Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 06:50:20 +0000



Post From: Potential bug displaying UTF-8 text

[2021-07-01 22:36:37]
autobahn - Posts: 25
I have the following code that places multiline text on the chart. UTF-8 characters print correctly sometimes but not consistently.

Here is what I would expect to be printed:

1: ␀
2: ┌
3: ⨍
4: ␀ ┌
5: ⨍ ┌
6: ␀ ⨍
7: ␀ ⨍ ┌

Here is what actually prints:
http://www.sierrachart.com/image.php?Image=1625178712716.png


I cannot understand why lines 1, 3, 6 do not display the symbol properly, yet lines 2, 4, 5, 7 are correct. The ⨍ and ␀ characters only print correctly when there is also a ┌ on the same line.

If anybody can reproduce this, or shed any light on what is happening, that would be appreciated.

If I create this as a user drawing, I can right-click and inspect the text properties and I see the correct symbols are there. They just aren't rendering properly on the chart.


// Some attributes removed for clarity

s_UseTool content;
content.AddMethod = UTAM_ADD_OR_ADJUST;
content.DrawingType = DRAWING_STATIONARY_TEXT;
content.MultiLineLabel = 1;
content.Text = "1: \xE2\x90\x80 \n" // ␀
"2: \xE2\x94\x8C \n" // ┌
"3: \xE2\xA8\x8D \n" // ⨍
"4: \xE2\x90\x80 \xE2\x94\x8C \n" // ␀ ┌
"5: \xE2\xA8\x8D \xE2\x94\x8C \n" // ⨍ ┌
"6: \xE2\x90\x80 \xE2\xA8\x8D \n" // ␀ ⨍
"7: \xE2\x90\x80 \xE2\xA8\x8D \xE2\x94\x8C \n"; // ␀ ⨍ ┌
content.FontFace = "Consolas";
sc.UseTool(content);