The MASM Forum

General => The Workshop => Topic started by: TouEnMasm on April 28, 2021, 06:22:41 PM

Title: strange char in edit control
Post by: TouEnMasm on April 28, 2021, 06:22:41 PM
Hello,
When i read a text like this one in the notepad,i got his:
Quote
the instruction's default operation
When I read it in an edit control,I get this
Quote
the instruction’s default operation
It is the '   who is badly interpreted,Naiional language used (Neutral instead of french) seem to be responsible of the trouble.
How to solve that any where ?


Title: Re: strange char in edit control
Post by: hutch-- on April 28, 2021, 06:26:41 PM
Yves,

See if it changes with the font you use.
Title: Re: strange char in edit control
Post by: jj2007 on April 28, 2021, 06:40:37 PM
Quote from: TouEnMasm on April 28, 2021, 06:22:41 PMthe instruction’s default

Your text file is Utf-8 encoded (as is most of the stuff you see on the web). Convert it to Utf-16 using MultiByteToWideChar, and load the result into the edit control with SetWindowTextW.

With wPrint wRec$ (https://www.jj2007.eu/MasmBasicQuickReference.htm#Mb1394)("the instruction’s default"), I see the instruction's default.
Title: Re: strange char in edit control
Post by: TouEnMasm on April 29, 2021, 12:33:11 AM

I have tested another font,no change.
Is it possible to made the edit control use another code (code page ..)?
Title: Re: strange char in edit control
Post by: jj2007 on April 29, 2021, 05:39:27 AM
The font isn't the culprit. Your OS knows how to display an apostrophe.

Did you convert the text to Utf-16 using MultiByteToWideChar?
Did you load the Utf-16 result into the edit control with SetWindowTextW?

Btw posting your code is always a good option :cool:
Title: Re: strange char in edit control
Post by: daydreamer on April 29, 2021, 05:51:52 AM
Quote from: TouEnMasm on April 29, 2021, 12:33:11 AM

I have tested another font,no change.
Is it possible to made the edit control use another code (code page ..)?
is it a local language thing,so change windows language to english solve it ?
or maybe some setting in resource files changes language?
I have some local ÅÄÖ myself
unicode edit control might solve it?
Title: Re: strange char in edit control
Post by: TouEnMasm on April 29, 2021, 03:44:34 PM

After many tests,with uni ansi codepage .. find the best soluce ......it's an old new secret......
NOTEPAD
The notepad had a menu where the file can be save with various Encoding as ANSI,UTF8,UTF16-LE ....
After that , i had just to change the one char who was not very pretty.
Thanks for help.