QT application programming: Solve the problem of no output and output Chinese garbled when using qDebug under Visual Studio

1. Environmental introduction

Operating system:  win10 64 bit

QT version:  5.12.6

Visual Studio IDE version:   2017

2. Set the subsystem as the console

Three, output Chinese garbled solution

Specify the encoding of the current text in the first line of the code page.

//指定文件的编码为UTF-8
#pragma execution_character_set("utf-8")

 

 

Guess you like

Origin blog.csdn.net/xiaolong1126626497/article/details/113085143