Skip to main content
Filter by
Sorted by
Tagged with
3 votes
1 answer
228 views

Here is my code: #include "snake.h" void SetPos(short x, short y) { //获得标准输出设备的句柄 HANDLE houtput = NULL; houtput = GetStdHandle(STD_OUTPUT_HANDLE); //定位光标的位置 COORD pos =...
tayir's user avatar
  • 61
3 votes
3 answers
131 views

In the C standard's C17 draft N2176 document, at 7.21.6.1.8, it says that If no precision is specified, the array shall contain a null wide character. If a precision is specified, no more than that ...
Cinverse's user avatar
  • 333
1 vote
1 answer
206 views

I'm currently trying to create an ada program (this will be relevante later on) with a basic TUI. To do so, I'm using ncurses, and more specifically, I'm interfacing with C as the ada bindings, ...
Akutchi's user avatar
  • 13
-1 votes
1 answer
203 views

I am trying to make a simple game using the ncursesw library which I am basically a complete noob at. I got the library working and I am now able to compile programs successfully with it. Now I am ...
AldoGP5's user avatar
  • 67
0 votes
1 answer
260 views

I found a very old post, which gives the answer as: LPCWSTR is a pointer to a const string buffer. LPWSTR is a pointer to a non-const string buffer. Just create a new array of wchar_t and copy the ...
CDv's user avatar
  • 11
4 votes
2 answers
246 views

Hello I want to print the letter 'å' which is 131 in extended ascii and as far as I can see has UTF-8 code 00E5 and 0x00E5 in UTF-16. However, in the code below the program prints 'Õ' which is not ...
Alexander Jonsson's user avatar
0 votes
2 answers
648 views

I'm trying to print wchar_t string to terminal but the string doesn't show up or it appears as unreadable characters. I tried on XUbuntu 22.04 and gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0 and you ...
David's user avatar
  • 59
-1 votes
1 answer
314 views

I'm writing a program that what it does first, is to retrieve the first command line argument (which should be a process name), and find the corresponding PID of the process. Here's how I do it: in ...
nortain32's user avatar
0 votes
1 answer
106 views

I am writing a function which prints a formatted string in a Windows console. It takes a simple C string which is a single byte string, converts it into a wide string for the Windows O.S., sends it to ...
user avatar
1 vote
1 answer
426 views

I have a procedure to capture a hidden Command Prompt window and display the output in a TMemo. This is the same/similar code that is posted all over the internet and Stack Overflow: var Form1: ...
Some1Else's user avatar
  • 849
-1 votes
1 answer
166 views

Im currently using wchar_t for a username, however, I'm having an issue when the username contains a space when using std::wcout as it will just get the first word typed. I am aware of getline for ...
Kryton's user avatar
  • 95
0 votes
3 answers
206 views

Certainly, my problem is not new...., so I apologize if my error is simply too stupid. I just wanted to become familiar with putwchar and simply wrote the following little piece of code: #include <...
Detlef Bosau's user avatar
0 votes
0 answers
172 views

I am writing a console program that processes files passed by the user as launch arguments (reads, processes in a certain way, writes to other files). The problem is that file paths can contain ...
Chase's user avatar
  • 43
0 votes
1 answer
234 views

Looking at replacing some id's in our main code base with UUIDs so that the ids can be used with multiple instances of our software. Before adding this functionality, I thought I would check out how ...
Friddy's user avatar
  • 101
4 votes
0 answers
148 views

I used _setmode(_fileno(stdout), _O_U8TEXT). I am trying to understand how wprintf() differs from printf(), so I am trying to understand the difference betweem putc() and fputwc(). I thought the ...
Schilive's user avatar
  • 283
0 votes
1 answer
107 views

According to embarcadero docs we can use different Format Specifier to output a buffer to the console in my case I have a function that reads from a stream and outputs to the console but sometimes the ...
loaded_dypper's user avatar
0 votes
1 answer
59 views

How to use ReadFile to read a buffer as wchar_t array and then output it to the console DWORD read_output() { BOOL success = FALSE; DWORD dwRead; HANDLE handle = CreateFileW(L"data....
loaded_dypper's user avatar
0 votes
0 answers
217 views

I have looked up various methods of converting wide strings to single-byte characters, but am unsure how to approach the char d_name[260] field of a struct dirent entry pertaining to a file with a ...
Gregor Hartl Watters's user avatar
1 vote
1 answer
308 views

I'm using ncurses 6.3, installed on OSX 12.0.1. My program is: #define NCURSES_WIDECHAR 1 #include <locale.h> #include <ncurses.h> int main() { setlocale(LC_ALL, ""); ...
Ned Ruggeri's user avatar
  • 1,138
1 vote
1 answer
174 views

If I read special characters from a file and then try to compare them (like with an if) it doesn't recognize them. std::wstring c; std::wifstream file; file.open("test.txt"); ...
Strox's user avatar
  • 29
0 votes
1 answer
347 views

I am trying to print unicode to the terminal under linux using the wchar_t type defined in the wchar.h header. I have tried the following: #include <wchar.h> #include <stdio.h> int main(...
hfhc2's user avatar
  • 4,462
1 vote
2 answers
121 views

I'm using Google Translate to convert some error codes into Farsi with Perl. Farsi is one such example, I've also found this issue in other languages---but for this discussion I'll stick to the ...
KJ7LNW's user avatar
  • 1,991
0 votes
2 answers
989 views

How can you read a file from a zip by opening the zip with a wide string file path? I only saw libraries and code examples with std::string or const char * file paths but I suppose they may fail on ...
BullyWiiPlaza's user avatar
0 votes
1 answer
426 views

Some of my Chinese software users noticed a strange C++ exception being thrown when my C++ code for Windows tried to list all running processes: 在多字节的目标代码页中,没有此 Unicode 字符可以映射到的字符。 Translated to ...
BullyWiiPlaza's user avatar
0 votes
3 answers
648 views

Below is an excerpt from an old edition of the book Programming Windows by Charles Petzold There are, of course, certain disadvantages to using Unicode. First and foremost is that every string in ...
mindoverflow's user avatar
1 vote
3 answers
929 views

I am trying to create an application in which I have a function where I am trying to duplicate a wide character string. I am currently using _wcsdup(), since it is a Windows application and everything ...
Rohit Nagpal's user avatar
1 vote
0 answers
107 views

I am trying to use wstring in a C++ program which is as follows:- #include<iostream> using namespace std; const wstring NAME = L"STACKOVERFLOW"; int main() { wcout<<NAME; } ...
Rohit Nagpal's user avatar
1 vote
1 answer
752 views

The problem I'm trying to solve is to get a couple ch,att representing the character and the associated attribute currently displayed at some given position. Now, when the displayed character is not a ...
JayTuma's user avatar
  • 63
0 votes
4 answers
969 views

I am looking for help with writing a C macro that expands into char* macro in one place and wchar_t* macro in another place. Eg: #define MACRO_STRING "Macro String" to atomic section with ...
Ganesh Kamath - 'Code Frenzy''s user avatar
2 votes
1 answer
757 views

I am having trouble converting text within an edit box to a WideChar. This is being used in code for printing emoji characters. If I manually set the WideChar values like the following it works Emoji[...
Some1Else's user avatar
  • 849
-2 votes
2 answers
997 views

I'm trying to use the Windows API in Visual Studio 2019. The problem is that when I'm trying to create a wide string, using something like this: L"Hello World!", I get an error: 'L': ...
H-005's user avatar
  • 515
0 votes
0 answers
35 views

I am trying to return locale names on windows system. For this I need to use swprintf() as follow in the code. #include <wchar.h> #include <shlwapi.h> #include <langinfo.h> ... /* ...
confucius_007's user avatar
0 votes
1 answer
1k views

I try to check the output of the get_wch function from the ncurses library, on Archlinux install. But when I call the function, I got this GCC error: main.c:6:15: warning: implicit declaration of ...
Apitronix's user avatar
  • 293
0 votes
1 answer
312 views

I'm running CodeBlocks in Windows 10 and even after following some of the indications found on SO, I did not manage to print in cosole utf8 chars. _setmode(_fileno(stdout), 0x00020000); // _O_U16TEXT ...
Cătălina Sîrbu's user avatar
1 vote
4 answers
1k views

Some Win32 API structures require to concatenate an extra null character to a string, as in the following example taken from here: c:\temp1.txt'\0'c:\temp2.txt'\0''\0' When it comes to wide strings, ...
gil_mo's user avatar
  • 635
2 votes
1 answer
135 views

I am trying to marshal a hid_device_info struct in C#, but I can't figure out how to translate the wchar_t* strings to managed C# strings. I have tried all possible values in the MarshalAs attribute, ...
Lázár Zsolt's user avatar
0 votes
0 answers
244 views

The following piece of code produces a file with a single byte when compiled in MSVC, but when compiled by GCC 8.3 it produces an empty file. std::wofstream out("tmpUTF16BrokenBOMFile.txt", ...
Ibraim Ganiev's user avatar
1 vote
1 answer
67 views

I'm writing a program which has to work with the characters ↓, → and ¬. I'm having trouble with reading and printing the characters. This works just fine: #include <iostream> #include <string&...
Maria Ayanyan's user avatar
0 votes
1 answer
71 views

I have the following long data that I want to transform to wide data based on a different column id_1<-c(1,2,3,4,4,4,4,5,5,5,5,5,6) h06b<-c(1,1,1,1,2,3,4,1,2,3,4,5,1) h07<-c(1,2,3,4,5,6,7,8,9,...
Sam Mwenda's user avatar
1 vote
1 answer
100 views

I have the following data that i want to convert from wide to long. id_1<-c(1,2,2,2) s02.0<-c(1,1,4,7) s02.1<-c(2,2,5,8) s02.2<-c(NA,3,6,NA) id_2<-c(1,1,2,3) df1<-data.frame(id_1,s02....
Sam Mwenda's user avatar
0 votes
1 answer
97 views

I have the following data set id<-c(1,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4) s02<-c(001,002,003,004,001,002,003,004,005,001,002,003,004,005,006,...
Sam Mwenda's user avatar
3 votes
1 answer
370 views

I stumbled upon a problem while going through some unit tests, and I am not entirely sure why the following simple example crashes on the line with sprintf (Using Windows with Visual Studio 2019). #...
Julius's user avatar
  • 1,285
0 votes
1 answer
453 views

I need to convert file names from System.String into std::string. I am using both Japanese and English file names. For English file names, there is no issue. Only Japanese file names are not ...
Saya's user avatar
  • 9
0 votes
1 answer
168 views

(sorry. might not be the most relevant question...) According to https://en.cppreference.com/w/cpp/language/string_literal: """ Wide string literal. The type of a L"..." string literal is const ...
chetzacoalt's user avatar
1 vote
1 answer
192 views

Function int _setmode(int, int) allows to switch stdout among ASCII and UTF (wide) modes. Is there a function to read the current translation mode of stdout? Something like _getmode? In C# there is ...
czerny's user avatar
  • 16.9k
2 votes
1 answer
137 views

I have to concatenate wide C-style strings, and based on my research, it seems that something like _memccpy is most ideal (in order to avoid Shlemiel's problem). But I can't seem to find a wide-...
user avatar
6 votes
1 answer
555 views

When I try to print the copyright symbol © with printf or write, it works just fine: #include <stdio.h> int main(void) { printf("©\n"); } #include <unistd.h> int main(void) { ...
S.S. Anne's user avatar
  • 15.7k
2 votes
0 answers
182 views

I've got an wide char string , where the content of it is read from a rich edit control. Because the corrupted content of strKeyW, application lately crashes ; and unfortunately I can't check why ...
Alexandru  Pirlog's user avatar
1 vote
1 answer
815 views

I want to create a file with the given location path that contains Unicode characters. I've tried the below code but after compiling my code no file is generated. wchar_t path = (wchar_t)"D:/File/ফো...
Md. Zakir Hossain's user avatar
1 vote
1 answer
2k views

With c++11 the regex library was introduced into the standard library. On the Windows/MSVC platform wchar_t has size of 2 (16 bit) and wchar_t* is normally utf-16 when interfacing with the system/...
darune's user avatar
  • 11.5k

1
2 3 4 5