有特殊字符,如A,C#搜索的imap命令e [英] C# Imap search command with special characters like á,é
问题描述
我工作的IMAP客户端的搜索功能。
I'm working on an imap client search function.
我使用这个命令: UID查找从的彼得的
I use this command: UID SEARCH FROM PÉTER
当我运行此命令我碰到下面的错误:
的错误的IMAP命令UID搜索:在原子8位数据的
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.
解决方案是什么?什么sholud怎么办?
What is the solution? What sholud I do?
编辑:
我尝试用UTF-8编码字符串( UID搜索彼得),它运行没有错误,但它不给任何回结果。
我检查测试电子邮件帐户,并有与此发件人许多邮件。
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.
推荐答案
在IMAP你需要。发送8位数据作为字符串文字
In IMAP you need to send 8-bit data as string literals.
语法:
{BYTE_COUNT} CRLF数的字节
Literal syntax: {byte_count} CRLF number-of-bytes
例如搜索:
cmdTag搜索字符集UTF-8的主题{4} CRLF测试CRLF
Example search: cmdTag SEARCH charset UTF-8 subject {4} CRLF test CRLF
这篇关于有特殊字符,如A,C#搜索的imap命令e的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!