LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   KMail doesn't apply a filter with euro sign (https://www.linuxquestions.org/questions/linux-software-2/kmail-doesnt-apply-a-filter-with-euro-sign-4175575493/)

ka3ak 03-21-2016 06:59 AM

KMail doesn't apply a filter with euro sign
 
I'm trying to create a filter on subject for incoming German emails

My regex looks so: \b([Bb]erufsunfähig.*|€)\b

(\b is word delimiter)

But it doesn't work for emails containing an euro sign in their subjects. First I thought that it should have something to do with unicode. But this part of regex \b[Bb]erufsunfähig.* work (contains a-umlaut), so unicode cannot be the cause of the problem.

smallpond 03-21-2016 09:56 AM

ISO-8859-1 (Latin 1) did not include the euro, but does include other common unicode characters. It was added in the replacement ISO-8859-15 (Latin 9). Most likely the mail is using the old encoding; lots of software does. Check the headers for the character encoding. Here's one in my inbox:

Code:

Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit

Note character set encoding is windows-1252, which is Latin-1 with the addition of the euro and a few other characters.

ka3ak 03-21-2016 10:19 AM

What I've seen in the email source is:

Quote:

...
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

All-Net & Surf 1 GB
Volle Power beim Surfen!
==================================================================

Lieber Herr ...
The subject of the email is:
Quote:

Ihre Handy-Flat für dauerhaft 6,99 € mtl.!
Of course I can create multiple filters as a workaround but it would still be interesting how to insert the euro sign into an existing regular expression with lots of logical ORs (|)

I have tried it with and with \u20AC with no luck.


All times are GMT -5. The time now is 08:32 AM.