diff --git a/lore-base/Cargo.toml b/lore-base/Cargo.toml index d85d371..c533f3d 100644 --- a/lore-base/Cargo.toml +++ b/lore-base/Cargo.toml @@ -33,9 +33,6 @@ rand = { workspace = true } serde = { workspace = true } uuid = { workspace = true, features = ["zerocopy"] } -# fs -windows-sys = { workspace = true, features = ["Win32_Storage_ProjectedFileSystem", "Win32_Storage_FileSystem", "Win32_System_Diagnostics", "Win32_System_Diagnostics_Debug", "Win32_System_IO", "Win32_Security"] } - # log chrono = { workspace = true } @@ -44,6 +41,10 @@ pin-project = { workspace = true } rayon = { workspace = true } tokio = { workspace = true } +# fs +[target.'cfg(target_family = "windows")'.dependencies] +windows-sys = { workspace = true, features = ["Win32_Storage_ProjectedFileSystem", "Win32_Storage_FileSystem", "Win32_System_Diagnostics", "Win32_System_Diagnostics_Debug", "Win32_System_IO", "Win32_Security"] } + [dev-dependencies] serde_json = { workspace = true, features = ["std"] } diff --git a/lore-client/Cargo.toml b/lore-client/Cargo.toml index 3d268b9..48e13b2 100644 --- a/lore-client/Cargo.toml +++ b/lore-client/Cargo.toml @@ -18,13 +18,15 @@ serde_json = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } toml = { workspace = true } -windows-sys = { workspace = true, features = ["Win32_System_Console", "Win32_Networking_WinSock"] } lore = { workspace = true } lore-base = { workspace = true } lore-error-set = { workspace = true } lore-revision = { workspace = true } +[target.'cfg(target_family = "windows")'.dependencies] +windows-sys = { workspace = true, features = ["Win32_System_Console", "Win32_Networking_WinSock", "Win32_Globalization"] } + [features] default = [] oodle = ["lore/oodle"] diff --git a/lore-client/src/cli/client_main.rs b/lore-client/src/cli/client_main.rs index 5e2990c..c355ef8 100644 --- a/lore-client/src/cli/client_main.rs +++ b/lore-client/src/cli/client_main.rs @@ -11,6 +11,14 @@ use crate::config::setup_config; use crate::logging; pub fn client_main() -> ExitCode { + #[cfg(target_family = "windows")] + // safety: safe Win32 call; no invariants to uphold + unsafe { + windows_sys::Win32::System::Console::SetConsoleOutputCP( + windows_sys::Win32::Globalization::CP_UTF8, + ) + }; + let time_start = Instant::now(); let cli = LoreCli::parse(); diff --git a/lore-revision/Cargo.toml b/lore-revision/Cargo.toml index 37c6a37..031feda 100644 --- a/lore-revision/Cargo.toml +++ b/lore-revision/Cargo.toml @@ -58,10 +58,12 @@ lore-proto = { workspace = true } lore-telemetry = { workspace = true } lore-transport = { workspace = true } uuid = { workspace = true, features = ["zerocopy"] } -windows-sys = { workspace = true, features = ["Win32_Storage_ProjectedFileSystem", "Win32_Storage_FileSystem", "Win32_System_Diagnostics", "Win32_System_Diagnostics_Debug", "Win32_System_IO", "Win32_Security"] } xxhash-rust = { workspace = true } zerocopy = { workspace = true } +[target.'cfg(target_family = "windows")'.dependencies] +windows-sys = { workspace = true, features = ["Win32_Storage_ProjectedFileSystem", "Win32_Storage_FileSystem", "Win32_System_Diagnostics", "Win32_System_Diagnostics_Debug", "Win32_System_IO", "Win32_Security"] } + [dev-dependencies] lore-storage = { workspace = true } serde_json = { workspace = true } diff --git a/lore/Cargo.toml b/lore/Cargo.toml index 98b575b..a8097d1 100644 --- a/lore/Cargo.toml +++ b/lore/Cargo.toml @@ -29,6 +29,8 @@ lore-transport = { workspace = true } lore-error-set = { workspace = true } lore-macro = { workspace = true } lore-notification = { workspace = true } + +[target.'cfg(target_family = "windows")'.dependencies] windows-sys = { workspace = true, features = ["Win32_Networking_WinSock"] } [build-dependencies]