From 12929fed7453b2c1757408c2626aeca412bdaec0 Mon Sep 17 00:00:00 2001 From: Peter Ammon Date: Sun, 10 Aug 2025 16:34:57 -0700 Subject: [PATCH] Adopt get_is_multibyte_locale in decode_input_byte Move away from MB_CUR_MAX --- src/input_common.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/input_common.rs b/src/input_common.rs index 989a4cccc..e9f8a96bb 100644 --- a/src/input_common.rs +++ b/src/input_common.rs @@ -1,6 +1,6 @@ use crate::common::{ - fish_reserved_codepoint, is_windows_subsystem_for_linux, read_blocked, shell_modes, - str2wcstring, WSL, + fish_reserved_codepoint, get_is_multibyte_locale, is_windows_subsystem_for_linux, read_blocked, + shell_modes, str2wcstring, WSL, }; use crate::env::{EnvStack, Environment}; use crate::fd_readable_set::{FdReadableSet, Timeout}; @@ -1699,10 +1699,8 @@ pub(crate) fn decode_input_byte( use DecodeState::*; let mut res: char = '\0'; let read_byte = *buffer.last().unwrap(); - if crate::libc::MB_CUR_MAX() == 1 { + if !get_is_multibyte_locale() { // single-byte locale, all values are legal - // FIXME: this looks wrong, this falsely assumes that - // the single-byte locale is compatible with Unicode upper-ASCII. res = read_byte.into(); out_seq.push(res); return Complete;