You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2010-03-11 10:49:30

danielb
Member
Registered: 2010-03-04
Posts: 19

Emailed tickets, Description Character encoding.

Hi there!
I have a problem with tickets that are emailed in, In the description field it cant handle foreign characters like åäö.
It shouldnt be a problem witht the mail-server as we are using it for other mails.
Also the subject of the ticket that gets mailed in are correct.
I have tried sending both from Outlook, Outlook Webclient, GMAIL & Hotmail. I still get the same problems
Subject: This is a test! ååäö

Description:

This is a test with åäö
BÃ¥ten
Flöt
Mötte
Ål
Rökte
Räkor


Mvh
Jöns Jönsson


Any suggestions on what might be the problem?

With kind regards
Daniel

Offline

#2 2010-03-12 10:20:09

mech
Member
Registered: 2010-01-13
Posts: 2

Re: Emailed tickets, Description Character encoding.

Hi
As a Swedish user we also have the same issue with the characters ÅÄÖ in mailreplies, we are running GLPI 0.72.3 on a Jumpbox Virtual Appliance.
Otherwise GLPI is awesome and it rocks! cool
//Anders

Offline

#3 2010-03-12 18:06:22

danielb
Member
Registered: 2010-03-04
Posts: 19

Re: Emailed tickets, Description Character encoding.

Yes, Maybe i should i add we are also running GLPI 0.72.3 but on a Ubuntu 9.04 machine,
does anyone else have this problem?

I agree that GLPI rocks wink keep up the good work

Offline

#4 2010-03-12 18:11:07

ddurieux
Plugins Dev
From: Propières, France
Registered: 2005-06-17
Posts: 7,521

Re: Emailed tickets, Description Character encoding.

Try with this patch :

# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
--- /Donnees/www/data-dist/glpi072/mailgate.class.php
+++ /Donnees/www/data-dist/glpi072/inc/mailgate.class.php
@@ -316,6 +316,10 @@
         // Do it before using charset variable
         $head['subject']=$this->decodeMimeString($head['subject']);
 
+      if (function_exists('mb_detect_encoding')){
+         $this->charset = mb_detect_encoding($body);
+      }
+
         if (!empty($this->charset)&&function_exists('mb_convert_encoding')){
             $body=mb_convert_encoding($body, 'utf-8',$this->charset);
         }

The problem is that the body of mail is in UTF-8 and defined in body as other charset. Try with this for all cases because I haven't yet tested with all possibilities and many mail server

Offline

#5 2010-03-12 18:41:11

danielb
Member
Registered: 2010-03-04
Posts: 19

Re: Emailed tickets, Description Character encoding.

ddurieux wrote:

Try with this patch :

# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
--- /Donnees/www/data-dist/glpi072/mailgate.class.php
+++ /Donnees/www/data-dist/glpi072/inc/mailgate.class.php
@@ -316,6 +316,10 @@
         // Do it before using charset variable
         $head['subject']=$this->decodeMimeString($head['subject']);
 
+      if (function_exists('mb_detect_encoding')){
+         $this->charset = mb_detect_encoding($body);
+      }
+
         if (!empty($this->charset)&&function_exists('mb_convert_encoding')){
             $body=mb_convert_encoding($body, 'utf-8',$this->charset);
         }

The problem is that the body of mail is in UTF-8 and defined in body as other charset. Try with this for all cases because I haven't yet tested with all possibilities and many mail server

Sorry for the stupid question but how do i deploy this patch?

With Kind Regards
Daniel

Offline

#6 2010-03-12 18:55:48

ddurieux
Plugins Dev
From: Propières, France
Registered: 2005-06-17
Posts: 7,521

Re: Emailed tickets, Description Character encoding.

search in inc/mailgate.class.php and add lines :

      if (function_exists('mb_detect_encoding')){
         $this->charset = mb_detect_encoding($body);
      }

before lines (about line 319) :

         if (!empty($this->charset)&&function_exists('mb_convert_encoding')){
             $body=mb_convert_encoding($body, 'utf-8',$this->charset);
         }

Offline

#7 2010-03-12 20:40:21

danielb
Member
Registered: 2010-03-04
Posts: 19

Re: Emailed tickets, Description Character encoding.

ddurieux wrote:

search in inc/mailgate.class.php and add lines :

      if (function_exists('mb_detect_encoding')){
         $this->charset = mb_detect_encoding($body);
      }

before lines (about line 319) :

         if (!empty($this->charset)&&function_exists('mb_convert_encoding')){
             $body=mb_convert_encoding($body, 'utf-8',$this->charset);
         }

Yes! It worked like a charm!
Merci to you ddurieux!


Kind Regards
Daniel

Offline

#8 2010-03-18 11:45:44

wilsonbill79
Member
Registered: 2010-03-11
Posts: 2

Re: Emailed tickets, Description Character encoding.

thanks.. this is great tip!


I have a Enhancement Advice Blog which I have done the research and reviewed various male enhancers available on the market, i.e. Reasons we need Sex. If you have any information to share, feel free to contact me.

Offline

Board footer

Powered by FluxBB