diff --git a/CHANGELOG.md b/CHANGELOG.md index 7585e4c..3f64252 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.0.14] - 2026-06-05 +## [1.0.15] - 2026-06-05 ### 修复 - 修复 Windows 桌面端打印卡死:打印字体由 OpenType/CFF 改为 TrueType(glyf),dart_pdf 渲染中文不再抛错(此前点「打印」后卡死) diff --git a/client/windows/runner/main.cpp b/client/windows/runner/main.cpp index 6a9f59b..78ecdfe 100644 --- a/client/windows/runner/main.cpp +++ b/client/windows/runner/main.cpp @@ -29,8 +29,11 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - // 窗口标题:用 u8 字面量 + UTF-8→UTF-16 转换,避免源码编码导致中文乱码。 - const std::string title_utf8 = u8"岩美酒库"; + // Window title as UTF-8 bytes (hex-escaped to keep this source pure ASCII and + // avoid MSVC C4819 under GBK code page 936). Decoded to UTF-16 for Win32. + // Bytes below are the UTF-8 encoding of the Chinese app title. + const std::string title_utf8 = + "\xE5\xB2\xA9\xE7\xBE\x8E\xE9\x85\x92\xE5\xBA\x93"; int title_len = ::MultiByteToWideChar(CP_UTF8, 0, title_utf8.c_str(), -1, nullptr, 0); std::wstring window_title(title_len > 0 ? title_len - 1 : 0, L'\0');