이 페이지에서

qt_allow_non_utf8_sources

Windows에서 소스 파일을 UTF-8로 강제 처리하는 것을 방지합니다.

이 명령어는 Qt6 패키지의 Core 컴포넌트에 정의되어 있으며, 다음과 같이 불러올 수 있습니다:

find_package(Qt6 REQUIRED COMPONENTS Core)

이 명령어는 Qt 6.0에서 도입되었습니다.

개요

qt_allow_non_utf8_sources(target)

버전 정보가 없는 명령어가 비활성화된 경우, 대신 qt6_allow_non_utf8_sources() 를 사용하십시오. 이 명령어는 본 명령어와 동일한 인자 세트를 지원합니다.

설명

Windows용 일부 컴파일러로 빌드할 때, Qt 라이브러리에 링크되는 타깃은 컴파일러가 해당 소스 파일을 UTF-8로 처리하도록 강제하는 플래그를 사용합니다. 이는 현재 Visual Studio 및 Intel 컴파일러에서 구현되어 있습니다. qt_allow_non_utf8_sources() 를 호출하고 타깃을 인수로 전달하여 타깃별로 이 동작을 비활성화할 수 있습니다.

참고: 이는 QString 와 같은 클래스의 런타임 동작을 변경하지 않습니다( const char * 에 정의된 해당 생성자는 올바르게 인코딩된 UTF-8 입력을 필요로 합니다). 이러한 코드를 식별하는 데는 QT_NO_CAST_FROM_ASCII 및 QT_RESTRICTED_CAST_FROM_ASCII 매크로를 사용하십시오.

{cmake-target-property-QT_NO_UTF8_SOURCE}

qt_disable_unicode_defines()도 참조하십시오 .

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.