Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prompt_password can't print Chinese prompt properly #97

Open
Jordan-Haidee opened this issue Jul 13, 2024 · 0 comments
Open

prompt_password can't print Chinese prompt properly #97

Jordan-Haidee opened this issue Jul 13, 2024 · 0 comments

Comments

@Jordan-Haidee
Copy link

Jordan-Haidee commented Jul 13, 2024

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:

璇疯緭鍏ュ瘑鐮侊細
  • I guess maybe this bug is caused by the default character encoding used in Microsoft Windows. In China, it defaults to be GBK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant