Skip to content

Commit fd16c14

Browse files
committed
fix(process): streamline system encoding handling for cross-platform compatibility
1 parent 6d65b39 commit fd16c14

File tree

1 file changed

+6
-7
lines changed
  • plugins/shell/src/process

1 file changed

+6
-7
lines changed

plugins/shell/src/process/mod.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ const NEWLINE_BYTE: u8 = b'\n';
2323
use tauri::async_runtime::{block_on as block_on_task, channel, Receiver, Sender};
2424

2525
pub use encoding_rs::Encoding;
26+
#[cfg(not(windows))]
27+
use encoding_rs::UTF_8;
28+
#[cfg(windows)]
29+
use encoding_rs::WINDOWS_1252;
2630
use os_pipe::{pipe, PipeReader, PipeWriter};
2731
use serde::Serialize;
2832
use shared_child::SharedChild;
@@ -473,17 +477,12 @@ fn spawn_pipe_reader<F: Fn(Vec<u8>) -> CommandEvent + Send + Copy + 'static>(
473477

474478
#[cfg(windows)]
475479
const fn get_system_encoding() -> &'static Encoding {
476-
use encoding_rs::WINDOWS_1252;
477480
WINDOWS_1252
478481
}
479482

480-
#[cfg(unix)]
483+
#[cfg(not(windows))]
481484
const fn get_system_encoding() -> &'static Encoding {
482-
// ! Remove afetr dev
483-
use encoding_rs::WINDOWS_1252;
484-
WINDOWS_1252
485-
// use encoding_rs::UTF_8;
486-
// UTF_8
485+
UTF_8
487486
}
488487

489488
// tests for the commands functions.

0 commit comments

Comments
 (0)