.NET Core Version:
Have you experienced this same bug with .NET Framework?
Problem description:
HelpProvider component is unable to show Unicode characters (e.g. Persian language):

I also have set the language for non-Unicode programs to "Persian" language (in regional settings):

Expected behavior:
Like all other controls and components, it should be able to show Unicode characters, regardless of the regional settings, or at least respect to regional settings.

Minimal repro:
var f = new Form();
f.HelpButton = true;
f.MinimizeBox = f.MaximizeBox = false;
var button = new Button()
{
Text = "Click on help button and then on me!",
AutoSize = true
};
f.Controls.Add(button);
var helpProvider = new HelpProvider();
helpProvider.SetHelpString(button, "賲鬲賳 丌夭賲丕蹖卮蹖");
helpProvider.SetShowHelp(button, true);
f.Show();
The problem is in Help class(.NET 4.X, .NET 5) which has created the HH_POPUP but hasn't specified any font for it. As a result the default font which doesn't support Unicode characters will be used. A possible fix could be using a default font like SystemFonts.CaptionFont which supports Unicode characters.
To demonstrate the possible fix, I've already implemented a HelpProvider2 (by modifying the built-in HelpProvider and fixing the problem as I mentioned above) which supports Unicode characters and also supports Font, ForeColor and BackColor:


Thank you for the investigation.
We'll need to have an internl discussion about it, but a fix could be something like this:
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Help.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Help.cs
index c815ba705..4cf558f62 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Help.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Help.cs
@@ -111,9 +111,18 @@ namespace System.Windows.Forms
clrForeground = new COLORREF(unchecked((uint)-1)), // Ignore
clrBackground = SystemColors.Window
};
+
+ var font = SystemFonts.CaptionFont;
+ string captionFont = $"{font.Name}, {font.Size}, , " +
+ $"{(font.Bold ? "BOLD" : "")}" +
+ $"{(font.Italic ? "ITALIC" : "")}" +
+ $"{(font.Underline ? "UNDERLINE" : "")}";
+
- fixed (char* pszText = caption)
+ fixed (char* pszText = caption, pszFont = captionFont)
{
pop.pszText = pszText;
+ pop.pszFont = pszFont;
+
ShowHTML10Help(parent, null, HelpNavigator.Topic, pop);
}
}
...and then it'd work as expected (I don't have any Arabic languages installed or configured):

It looks like we have 2 possible approaches here:
For now my preference is #1. I'd like to take a little bit of time to figure out how we get the font for ToolTips, if in fact they do support unicode characters. Then we should attempt to match. Failing that the SystemFonts.CaptionFont seems quite reasonable to me.
SystemFonts.StatusFont looks a good option. Its value comes from NONCLIENTMETRICSA.lfStatusFont which returns the font used in status bars and tooltips. WPF ToolTip also uses the same as its default font.
Thank you, I think it is a good choice. Though it is hard to check, all fonts appear to be the same on W10 by default:

Most helpful comment
Thank you for the investigation.
We'll need to have an internl discussion about it, but a fix could be something like this:
...and then it'd work as expected (I don't have any Arabic languages installed or configured):
