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

Feature request: support search Non-ASCII characters #278

Open
Tsai002 opened this issue Jan 10, 2024 · 1 comment
Open

Feature request: support search Non-ASCII characters #278

Tsai002 opened this issue Jan 10, 2024 · 1 comment

Comments

@Tsai002
Copy link

Tsai002 commented Jan 10, 2024

Use uid_search directly

let query = "UID SEARCH CHARSET UTF-8 BODY {6}\r\n测试";
imap_session.uid_search(query)

resp: Error: Unexpected Response: Continue { code: None, information: Some("send literal data") }

Use run_command_and_read_response

let query = "UID SEARCH CHARSET UTF-8 BODY {6}\r\n测试";
let rsp = imap_session.run_command_and_read_response(query).unwrap();
println!("{:?}", String::from_utf8_lossy(&rsp));

resp: "+ send literal data\r\n* SEARCH 11111\r\n* FLAGS (\\Answered \\Deleted \\Draft \\Flagged \\Seen $Forwarded $MDNSent Forwarded $Junk $NotJunk Junk JunkRecorded NonJunk NotJunk $label3 $label2 $label4)\r\n"

ref: https://stackoverflow.com/questions/10131131/imap-search-command-with-utf-8-charset-in-c-sharp

@jonhoo
Copy link
Owner

jonhoo commented Jan 20, 2024

Oh, I didn't even know about this feature!
I agree, this would be a good thing to support 👍 PRs welcome 😅
It might require a dedicated command variant though since the expected response from the server is different 🤔

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

2 participants