Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - UTF-8 in manifest in non-Unicode build
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

UTF-8 in manifest in non-Unicode build

 Post Reply Post Reply
Author
Message
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Topic: UTF-8 in manifest in non-Unicode build
    Posted: 07 June 2024 at 3:54am
When  I build my application exe and the XTToolkit DLL using Unicode everything works as expected.

But I'm testing different language combinations to better understand what is going on.
When I build both my application and the XTToolkit Pro using non-Unicode I have problems seeing e.g. simplified Chinese characters in my program. This is of cause expected.
Then I set the manifest file for my exe to include the line:
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
This makes my exe using the MFC controls able to show the simplified Chinese characters correctly. However the controls used by the XTToolkit don't shot the text as UTF-8. 


See the example above, where a simple MFC dialog belonging to my exe shows the text correctly, but the XTPGrid display the same text incorrectly.

So, what is the problem?
How do I tell the XTToolkit DLL to use UTF-8?
Do I need to set the same manifest for the XTPToolkit DLL I build?
Do I need to set something like this?
XTPResourceManager()->GetLanguageInfo()->nCodePage


Edit....

It seems that adding the manifest to the XTToolkit DLL does not make a difference ?
But, enabling the "Beta: Use Unicode UTF-8  for worldwide language support" regional settings feature in Windows 10/11 solves the problem in the XTToolkit controls. So the question is then, how do I enable this programmatically or through a manifest for the XTToolkit DLL controls?

Any Ideas?
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2024 at 7:38am
I think that the reason is:

Quote GDI doesn't currently support setting the ActiveCodePage property per process. Instead, GDI defaults to the active system codepage. To configure your app to render UTF-8 text via GDI, go to Windows Settings > Time & language > Language & region > Administrative language settings > Change system locale, and check Beta: Use Unicode UTF-8 for worldwide language support. Then reboot the PC for the change to take effect.

From: https://learn.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page.

Since XTToolkit uses a lot of DrawText GDI for custom drawings of items, controls etc.

Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.