gmail - IMAP search for non-ascii characters -


what command used search non ascii or japanese characters in imap gmail server?

the correct way use charset utf-8 search literal. example (each line ends \r\n):

> tag uid search charset utf-8 text {4} < + go ahead > term < * search 700 701 702 < tag ok search done 

term should utf-8 encoded, , 4 should length of search therm, in bytes after encoding.

for example, search term 日本 \xe6\x97\xa5\xe6\x9c\xac in utf-8 encoding (6 bytes)

> tag uid search charset utf-8 text {6} < + go ahead > <6 bytes of binary data> < * search 700 701 702 < tag ok search done 

you can use different search keys besides text, such body or to. searching in utf-8 should work on reasonable imap server. other character sets less supported.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -