This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit b66c8d01c758333361cd2e60f07daebb6dd53aaa
Author: xuxin19 <[email protected]>
AuthorDate: Fri Nov 20 17:34:55 2026 +0800

    cmake(bugfix):add UTF-8 encoding declaration for .config parsing
    
    Without an ENCODING option, file(STRINGS) only extracts ASCII strings
    and treats any other byte as a separator. A .config string value that
    contains UTF-8 characters is then split into several entries, and the
    generated config.h is broken.
    
    Read .config with ENCODING UTF-8 in nuttx_mkconfig.cmake.
    
    Signed-off-by: xuxin19 <[email protected]>
---
 cmake/nuttx_mkconfig.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake/nuttx_mkconfig.cmake b/cmake/nuttx_mkconfig.cmake
index b96c7fc539d..66319c45a5d 100644
--- a/cmake/nuttx_mkconfig.cmake
+++ b/cmake/nuttx_mkconfig.cmake
@@ -95,7 +95,7 @@ file(APPEND ${CONFIG_H}
      "/* General Definitions ***********************************/\n")
 file(APPEND ${CONFIG_H} "#define CONFIG_BASE_DEFCONFIG 
\"${BASE_DEFCONFIG}\"\n")
 
-file(STRINGS ${NUTTX_BINARY_DIR}/.config ConfigContents)
+file(STRINGS ${NUTTX_BINARY_DIR}/.config ConfigContents ENCODING UTF-8)
 encode_brackets(ConfigContents)
 foreach(NameAndValue ${ConfigContents})
   decode_brackets(NameAndValue)

Reply via email to