conradkleinespel / rpassword

Cross platform Rust library to read a password in the terminal (Linux, BSD, OSX, Windows, WASM).
Apache License 2.0
244 stars 38 forks source link

`prompt_password` can't print Chinese prompt properly #97

Open Jordan-Haidee opened 2 months ago

Jordan-Haidee commented 2 months ago

My test code is

use rpassword::prompt_password;

#[test]
fn test_prompt_password() {
    let passwd = prompt_password("请输入密码:").unwrap();
}

where the prompt is simplified Chinese. It should print given prompt:

"请输入密码:" 

if everything is ok. But now its output is messy code:

璇疯緭鍏ュ瘑鐮侊細