wchar.h is a header file in the C standard library. It is a part of the extension to the C programming language standard done in 1995. It contains extended multibyte and wide character utilities. The standard header
Questions tagged [wchar]
196 questions
0
votes
1 answer
Strange behavior with QString
Here's my code:
#include
#include
#include
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QTextStream out(stdout);
QString filename = "F:/temp/йцук.tx";
out <<…

solestate
- 59
- 2
- 11
0
votes
0 answers
Convert string to wstring using wsprintf
I was trying to create a function that converts a string to a wstring, using the built-in function wsprintf.
For some reason, when I try to print the result wstring, nothing is printed,
and when I try debugging, I saw it contains letters in Chinese…

aviad1
- 354
- 1
- 10
0
votes
1 answer
C++ Convert char to CString
before i looked at all similar threads on every forum but i didn't found a solution which works for me.
I'm a very beginner in C++, so please don't be to strict with me.
My Problem is that i want to open a file, and read the characters with a…

C. B.
- 13
- 1
0
votes
1 answer
cannot convert 'LPCWSTR {aka const wchar_t*}' to 'const char*' for argument '1' to 'int printf(const char*, ...)'
I never try coding in C for the last four or five years so I don't know how to solve this problem.
My code is like this:
char szExePath[MAX_PATH]; //
//"C:\\Program Files (x86)\\Application Verifier\\vrfauto.dll"
printf("Please input the execution…

zakir shah
- 1
- 1
0
votes
1 answer
Compare two wchar arrays within nested for loops?
hope someone can help me figure this out
i´m kind of new to C++ and programing..
I have 2 different arrays first one is Alphabet from a-z
second is a integer array filled with virtual keycodes representing a-z.
the functions takes in a const wchar*…
user12095146
0
votes
1 answer
Use wtoi with radix in c++
I need to convert a hex value stored in a wchar_t c-style string to an int. the atoi function has the parameter radix for this, but the wtoi only takes a wchar_t. Is there a function(usable for c++, much c functions are deprecated in c++) or another…
user11568109
0
votes
1 answer
Expected encoding of wcwidth() argument
I'm trying to find out what the expected encoding of wcwidth() argument is.
The man page says absolutely nothing about this, and I wasted hours trying to
find out what it is. Here's an example, in C:
#include
#include
void…

sinan
- 6,809
- 6
- 38
- 67
0
votes
0 answers
Trouble printing out character (♭ U+266D) on console using wprintf
I want to print the musical flat symbol: ♭ (U+266D) on a console. I use wchar_t and wprintf() to do that, but it always prints out ? instead of ♭. I tried setmode() and setlocale() as well, as you can see down in the code, but neither of them was…

Hakura
- 1
0
votes
2 answers
How to convert CString to Windows API and custom functions that use WCHAR?
So I have thousands of functions in my C++ code that take in as a parameter such as:
void SomeFunction(WCHAR *sSomeStringIn)
{
...
}
And within the function, it call Windows APIs such as:
GetWindowsText(...)
How do I send a CString…

JeffR
- 765
- 2
- 8
- 23
0
votes
1 answer
How do I initialize a WCHAR string from an ascii string that is #defined. L prefix is not included
In Windows driver C code, I need to set a WCHAR array to a string that is #defined in a header file. The header file specifies an ascii string. It does not specify the L prefix for the string.
// In the header file
#define VERS_STR "3.2.4"
// In…

Louie
- 11
- 2
0
votes
0 answers
Function in function with the same variables gives me incorrect output
I have to write a program that is using polish characters. The problem is with function in a function, both have the same one of variables(like a(int smth) b(int smth), this smth is the same one that had been used in both)
I have open_dyk function…

Amatheon
- 29
- 5
0
votes
1 answer
Should I use wchar or char to encrypt?
I have this code working to create a hash of the key to encrypt a string using Wincrypt:
wchar_t key[] = L"123456789AFA11";
wchar_t *key_str = key;
size_t len = lstrlenW(key_str);
DWORD dwStatus = 0;
BOOL bResult = FALSE;
wchar_t info[] =…
user8554358
0
votes
0 answers
wchar.h: error: '__FILE' was not declared in this scope' error with gcc 5.2.0
I am having trouble compiling code
before it ever gets to the linker. Can anyone point me in the right
direction?
Here is the very simple code of source to reproduce this issue.
// CpxCryptoIfSimClientC.cpp //
#include
// end …

Govardhan Reddy
- 115
- 1
- 11
0
votes
0 answers
Reading an input of mixed unicode characters and integers
I am trying to read the following input from user where the input looks like :
3
5 斤 2 两
7 斤 3 两
6 斤
to solve this question : https://uva.onlinejudge.org/external/125/12555.pdf
However, I have no success so far. I have googled a lot, but I am not…

Naveen
- 7,944
- 12
- 78
- 165
0
votes
1 answer
Why writing wchar string to file doesn't work in C
I want my program to take a wchar string from the user and print it to a file,but even though it print the string to the command prompt correctly,when it comes to the file it only prints the ascii characters, any other characters is printed…

Paulo Cezar Sousa Paes
- 51
- 1
- 7