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
Post a Comment