2

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.

user829081
  • 164
  • 1
  • 17

1 Answers1

2

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

Ivar
  • 491
  • 3
  • 2