Wine didn't output properly

Questions about Wine on Linux
Locked
Allen123456hello
Newbie
Newbie
Posts: 1
Joined: Mon Jan 13, 2025 7:50 am

Wine didn't output properly

Post by Allen123456hello »

I'm running my C++program in Wine, running it directly in Wine,But it outputs garbled code.However, redirecting the output to a file and output the content of this file can obtain the correct output:

Code: Select all

user@localhost:~/winetest$ cat main.cpp
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main(){
    puts("😃😄😆");
    return 0;
}
user@localhost:~/winetest$ x86_64-w64-mingw32-g++ -m64 -g -lm -O2 --std=c++14 -static -Wall -Wextra -o main.exe main.cpp -fexec-charset=UTF-8 -finput-charset=UTF-8
user@localhost:~/winetest$ wine main.exe
ðð
ð
user@localhost:~/winetest$ wine main.exe > output
user@localhost:~/winetest$ cat output
😃😄😆
user@localhost:~/winetest$ echo $LC_ALL
en_US.UTF-8
user@localhost:~/winetest$
Is it a wine bug or a program issue?How to fix it?Thank you.
Locked