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()도 참조하세요 .
© 2025 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.