qt_allow_non_utf8_sources
Evita que los archivos fuente se traten obligatoriamente como UTF-8 en Windows.
El comando se define en el componente ` Core ` del paquete ` Qt6 `, que se puede cargar de la siguiente manera:
find_package(Qt6 REQUIRED COMPONENTS Core)Este comando se introdujo en Qt 6.0.
Sinopsis
qt_allow_non_utf8_sources(target)Si los comandos sin versión están desactivados, utiliza en su lugar qt6_allow_non_utf8_sources(). Admite el mismo conjunto de argumentos que este comando.
Descripción
Al compilar con algunos compiladores para Windows, los objetivos que se vinculan a una biblioteca Qt utilizan opciones que obligan al compilador a tratar sus archivos fuente como UTF-8. Actualmente, esto está implementado para los compiladores de Visual Studio e Intel. Puedes desactivar este comportamiento para cada objetivo llamando a qt_allow_non_utf8_sources() y pasando el objetivo como argumento.
Nota: Esto no modifica el comportamiento en tiempo de ejecución de clases como ` QString ` (su constructor, definido en ` const char * `, requiere una entrada UTF-8 correctamente codificada). Utiliza las macros ` QT_NO_CAST_FROM_ASCII ` y ` QT_RESTRICTED_CAST_FROM_ASCII ` para ayudar a identificar dicho código.
{cmake-target-property-QT_NO_UTF8_SOURCE}
Véase también 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.