How can I Search non-English characters using Get IMAP Mail Message activity?


I’ve been trying to get emails with a specific subject from the Gmail server by using Get IMAP Mail Messages activity.
I was able to filter subjects by English alphabet such as “RPA”
but failed to filter subjects by non-English alphabets such as “파일”(Korean word for “file”).
I’ve tried to change FilterExpressionCharacterSet to “UTF-8” which supports the language.
I also tried to include “CHARSET UTF-8” in the FilterExpression, but all of these attempts returned a ‘BAD’ response.

I have read the official document about this activity :

But this page does not specifically explains all filter methods properly.

I’ve also looked into this page to see if such a method also works,
but I am still getting a ‘BAD’ response as long as I insert Korean in the expression:

Is it possible to filter IMAP messages for Korean or other non-English alphabets?
If not, what other methods should I consider?


Hi @jspark, welcome to the Community.

You can use the logic behind the ASCII values of the characters to filter out non-English subjects. Please refer to the following steps:

  1. Use RegEx ‘Matches’ activity and set the subject to the text read from the file.
  2. Set the regular expression pattern to match only English characters: [^\x00-\x7F]+
  3. The output of the ‘Matches’ activity will be a collection of all matches found in the input subject.
  4. You can use a condition to check if the collection is empty, and then perform further actions based on the result.


Hope this helps,
Best Regards.

Thanks, @arjunshenoy !
That is surely helpful when I am trying to exclude mails by usages of specific alphabet.

Is there any methods you might know about enabling IMAP Searching for some specific Korean characters possible?

It seems like it’s not possible through Get IMAP Mail Message.

Although it’s not the most optimized method,
I’ve just collected all mails without such filter first,
then filtered within the UiPath using if activities…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.