Special Chars like ° è in Subject

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
Wichert
New user
New user
Posts: 12
Joined: 2019-10-07 15:02

Special Chars like ° è in Subject

Post by Wichert » 2021-06-14 13:52

Hi,

we have some Scripts witch change the E-Mail Body in the right Format for us.

Now i have the Problem that the Topic has following chars and the rule wont work. (France special Chars)

Original Subject: "701 N° de pièce 2018006532"
I want search for "701 N° de piéce" and change it to e.g. "Facture"

My code works fine with normal Chars.

Code: Select all

  
if Left(oMessage.Subject,15) = "701 N° de pièce" Then
  oMessage.Subject = "Facture" & right(oMessage.Subject,len(oMessage.Subject)-15)
  oMessage.Save
End if
I hope someone can help me.

Best Regards

User avatar
katip
Senior user
Senior user
Posts: 907
Joined: 2006-12-22 07:58
Location: Istanbul

Re: Special Chars like ° è in Subject

Post by katip » 2021-06-14 14:37

have a look at this:
https://www.rapidtables.com/code/text/ascii-table.html
try ChrW(232) and 176 (or 186, not sure) in your script.

Code: Select all

if Left(oMessage.Subject,15) = "701 N" & ChrW(176) & " de pi" & ChrW(232) & "ce" Then
maybe it works..
Katip
--
HMS 5.7.0, MariaDB 10.4.10, SA 3.4.2, ClamAV 0.103.2

User avatar
SorenR
Senior user
Senior user
Posts: 4712
Joined: 2006-08-21 15:38
Location: Denmark

Re: Special Chars like ° è in Subject

Post by SorenR » 2021-06-14 14:38

katip wrote:
2021-06-14 14:37
have a look at this:
https://www.rapidtables.com/code/text/ascii-table.html
try ChrW(232) and 176 (or 186, not sure) in your script.

Code: Select all

if Left(oMessage.Subject,15) = "701 N" & ChrW(176) & " de pi" & ChrW(232) & "ce" Then
maybe it works..
Or RegEx..

(i'm away from my computer)
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

Wichert
New user
New user
Posts: 12
Joined: 2019-10-07 15:02

Re: Special Chars like ° è in Subject

Post by Wichert » 2021-06-22 10:31

Hi,

that is exactly what i need.
Thanks a lot for you help.

Best Regards
Wichert

Post Reply