From b71f60108860c7b9d6b0e0ed05a108f33bdef56b Mon Sep 17 00:00:00 2001 From: anry Date: Fri, 20 Feb 2026 16:29:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8ai=E8=A7=A3=E5=86=B3=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E4=B8=8D=E4=B8=80=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 17 +++++++++++++++++ .vscode/settings.json | 14 ++++++++++++++ CMakeLists.txt | 4 ++++ 3 files changed, 35 insertions(+) create mode 100644 .editorconfig create mode 100644 .vscode/settings.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0daffa3 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig helps maintain consistent coding styles +# https://editorconfig.org + +root = true + +[*] +charset = utf-8-bom +end_of_line = crlf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{cpp,h,hpp}] +indent_style = tab + +[*.{json,xml,yml,yaml,md}] +indent_style = space +indent_size = 2 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..02f49e3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,14 @@ +{ + "files.encoding": "utf8", + "files.autoGuessEncoding": false, + "editorconfig.enable": true, + "[cpp]": { + "files.encoding": "utf8-bom" + }, + "[h]": { + "files.encoding": "utf8-bom" + }, + "[c]": { + "files.encoding": "utf8-bom" + } +} diff --git a/CMakeLists.txt b/CMakeLists.txt index 61ef02a..f376bb4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,10 @@ add_definitions(-D_UNICODE) add_definitions(-DUNICODE) add_definitions(-DWIN32_LEAN_AND_MEAN) +# Force UTF-8 encoding for source files to avoid encoding issues +# when editing in VSCode and building in VS2022 +add_compile_options(/utf-8) + # Set runtime library: MTD for Debug, MT for Release # This ensures static linking to the C/C++ runtime set_target_properties(EzUI PROPERTIES