fn try_decode(mut v: Vec<u8>, w: WINDOW) -> Result<String, FromUtf8Error> {
                let res = String::from_utf8(v.clone());
                if res.is_err() && v.len() < 4 {
                    let next_byte = unsafe { wgetch(w) };
                    v.push(next_byte as u8);
                    try_decode(v, w)
                } else {
                    res
                }
            }
// Assume that on Linux input is UTF-8
Assume that on Linux input is UTF-8
Assume that on Linux input is UTF - 8
fn try_decode(mut v: Vec<u8>, w: WINDOW) -> Result<String, FromUtf8Error> {
                let res = String::from_utf8(v.clone());
                if res.is_err() && v.len() < 4 {
                    let next_byte = unsafe { wgetch(w) };
                    v.push(next_byte as u8);
                    try_decode(v, w)
                } else {
                    res
                }
            }
fn try_decode ( mut v : Vec < u8 > , w : WINDOW ) -> Result < String , FromUtf8Error > { let res = String :: from_utf8 ( v . clone ( ) ) ; if res . is_err ( ) && v . len ( ) < 4 { let next_byte = unsafe { wgetch ( w ) } ; v . push ( next_byte as u8 ) ; try_decode ( v , w ) } else { res } }
Assume that on Linux input is UTF-8
Assume that on Linux input is UTF - 8
v
Vec<u8>
w
WINDOW
v
Vec<u8>
w
WINDOW