Pelles C forum
C language => Windows questions => Topic started by: bitcoin on November 27, 2021, 01:51:36 PM
-
Hello,
I have some dialog with edit control, but I can't copy-paste symbols like ☣ - it transforms to ?
Project-properties-encoding == utf-16 . What can I do?
-
Have you defined UNICODE in project
-
Hello,
I have some dialog with edit control, but I can't copy-paste symbols like ☣ - it transforms to ?
Project-properties-encoding == utf-16 . What can I do?
It is not very simple to do. How the C source code page is encoded itself really has nothing to do with it unless the source module is actually loading or storing Unicode characters for example into an array of characters. So a project could have source files in ANSI, UTF-8, UTF-16 all in the same build. Micro$oft windows controls all use UTF-16 internally. Are you sure you know you are pasting a Unicode character? It might be UTF-8 for example.
TimoVJL points you to how to start . . .a lot of study after that.
John Z
Try copying smile from here and paste into your control:
https://de.wikipedia.org/wiki/Unicodeblock_Smileys
😀
Copy the face 😇 not the code U+1F607 (128519)
-
Have you defined UNICODE in project
how to do this? Can't find in help.
Are you sure you know you are pasting a Unicode character? It might be UTF-8 for example.
May be.. But Visual Studio dialogs accept such symbols (project-general-character set)
-
Project options -> Compiler -> Preprocessor -> Define symbols
pocc -DUNICODE
-
Have you defined UNICODE in project
how to do this? Can't find in help.
If using the Pelles C UI IDE then
#define WIN32_LEAN_AND_MEAN
/* #define NOCRYPT */
/* #define NOSERVICE */
/* #define NOMCX */
/* #define NOIME */
#define UNICODE
#define _UNICODE
#include <windows.h>
#include <windowsx.h>
is an example of where you might place the UNICODE defines. Be prepared to learn about
MultiByteToWideChar and
WideCharToMultiByte as well.
In Pelles C Help search for _UNICODE click on the topic '<tchar.h> include files' you will find more information on using UNICODE
Also look at 'Program startup: the main and WinMain functions' in Pelles Help.
John Z
-
Project options -> Compiler -> Preprocessor -> Define symbols
pocc -DUNICODE
fatal error #1051: Invalid -D or -U argument: -DUNICODE.
#define UNICODE
#define _UNICODE
This works!
-
Project options -> Compiler -> Preprocessor -> Define symbols
pocc -DUNICODE
fatal error #1051: Invalid -D or -U argument: -DUNICODE.
TimoVJL was mentioning two different methods: A) where in the UI IDE and B) an example of compiling from the command line and passing a command line option. See attachments below.
I found doing UNICODE is hard work, but worth it eventually. :)
John Z
-
Pelles C Add-Ins use UNICODE.
All sources, that needs UNICODE version might just use #define UNICODE and then readers know that too.
MS Visual Studio hides too many things and it's slow and awkward, needs very fast PC.