问题
I'm working on an imap client search function.
I use this command: UID SEARCH FROM PÉTER
When I run this command i get the following error: Error in IMAP command UID SEARCH: 8bit data in atom
I get this error when my pattern string(for example PÉTER) contains accentuated character.
What is the solution? What sholud I do?
Edit: I try with UTF-8 encoded string (UID SEARCH FROM PÉTER), it runs without error, but it doesn't give back any result. I check the test email account, and there are many mails with this sender.
回答1:
In IMAP you need to send 8-bit data as string literals.
Literal syntax: {byte_count} CRLF number-of-bytes
Example search: cmdTag SEARCH charset UTF-8 subject {4} CRLF test CRLF
来源:https://stackoverflow.com/questions/7426661/c-sharp-imap-search-command-with-special-characters-like-%c3%a1-%c3%a9