Skip to content

Commit

Permalink
Upgrade encode_unicode to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Dec 16, 2024
1 parent 59ef42d commit 0baff7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ unicode-width = { version = "0.2", optional = true }
lazy_static = "1.4.0"

[target.'cfg(windows)'.dependencies]
encode_unicode = "0.3"
encode_unicode = "1"

[target.'cfg(windows)'.dependencies.windows-sys]
version = "0.52.0"
Expand Down
6 changes: 3 additions & 3 deletions src/windows_term/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::os::windows::ffi::OsStrExt;
use std::os::windows::io::AsRawHandle;
use std::{char, mem::MaybeUninit};

use encode_unicode::error::InvalidUtf16Tuple;
use encode_unicode::error::Utf16TupleError;
use encode_unicode::CharExt;
use windows_sys::Win32::Foundation::{HANDLE, INVALID_HANDLE_VALUE, MAX_PATH};
use windows_sys::Win32::Storage::FileSystem::{FileNameInfo, GetFileInformationByHandleEx};
Expand Down Expand Up @@ -398,13 +398,13 @@ pub fn read_single_key(_ctrlc_key: bool) -> io::Result<Key> {
}
}
// This is part of a surrogate pair. Try to read the second half.
Err(InvalidUtf16Tuple::MissingSecond) => {
Err(Utf16TupleError::MissingSecond) => {
// Confirm that there is a next character to read.
if get_key_event_count()? == 0 {
let message = format!(
"Read invlid utf16 {}: {}",
unicode_char,
InvalidUtf16Tuple::MissingSecond
Utf16TupleError::MissingSecond
);
return Err(io::Error::new(io::ErrorKind::InvalidData, message));
}
Expand Down

0 comments on commit 0baff7a

Please sign in to comment.