Print Page | Close Window

UTF-8 in manifest in non-Unicode build

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=24483
Printed Date: 07 September 2024 at 8:53pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: UTF-8 in manifest in non-Unicode build
Posted By: cpede
Subject: UTF-8 in manifest in non-Unicode build
Date 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 (22.1.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)



Replies:
Posted By: cpede
Date 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:  http://learn.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page" rel="nofollow - 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 (22.1.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net