208 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
1
answer
228
views
Encounter a problem that print wide_character in C
Here is my code:
#include "snake.h"
void SetPos(short x, short y)
{
//获得标准输出设备的句柄
HANDLE houtput = NULL;
houtput = GetStdHandle(STD_OUTPUT_HANDLE);
//定位光标的位置
COORD pos =...
3
votes
3
answers
131
views
behaviour of fprintf when 'ls' format specifier is used with precision set for printing string of wide characters
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 ...
1
vote
1
answer
215
views
Adding wide character support breaks ncurses menu
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, ...
-1
votes
1
answer
204
views
NCURSESW - Unable to use addwstr function to print out unicode characters outside of standard ASCII
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 ...
0
votes
1
answer
262
views
How to I get the contents from a wchar_t array into a LPWSTR?
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 ...
4
votes
2
answers
246
views
Problem with printing wide character in c
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 ...
0
votes
2
answers
651
views
print unicode character on linux using gcc
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 ...
-1
votes
1
answer
315
views
Wide string command line arguments in C
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 ...
0
votes
1
answer
106
views
Do I need to free memory after call to WriteConsoleW?
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 ...
1
vote
1
answer
426
views
Capture Unicode command line output
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: ...
-1
votes
1
answer
166
views
wchar_t user input with spaces
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 ...
0
votes
3
answers
206
views
I have difficulties with putwchar() in c
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 <...
0
votes
0
answers
172
views
Parse non-ascii string from argv in 'main' function C++
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 ...
0
votes
1
answer
234
views
Issues getting UuidToStringW to generate a proper UUID string
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 ...
4
votes
0
answers
148
views
How does the Windows terminal know if I wrote a wide character or a normal character?
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 ...