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 2008-10-22 16:12:20

Taras_
Member
From: Russia
Registered: 2006-04-25
Posts: 57
Website

Error in mail message body encoding to utf-8 (solution)

Here is discussion:
http://glpi-project.org/forum/viewtopic.php?id=11348
and here
http://glpi-project.org/forum/viewtopic.php?id=10054

mailgate.class.php has at least one bug related to encoding message body to utf-8 when building ticket.
this->charset may be initialized only in decodeMimeString() which called AFTER encoding body.
Simple solution is placing call to decodeMimeString() BEFORE body encoding.

// Now decodeMimeString() call is here
                $head['subject']=$this->decodeMimeString($head['subject']);

// This condition was never met
                if (!empty($this->charset)&&function_exists('mb_convert_encoding')){
                        $body=mb_convert_encoding($body, 'utf-8',$this->charset);
                }

                if (!seems_utf8($body)){
                        $tkt['contents']= utf8_encode($body);
                }else{
                        $tkt['contents']= $body;
                }
                // Add message from getAttached
                if ($this->addtobody) {
                        $tkt['contents'] .= $this->addtobody;
                }
// decodeMimeString() call was here

Hope, it change will be made in both stable and unstable (both are affected as i understand).


Multiple GLPI instances. Thanks to developers! smile

Offline

#2 2008-10-23 17:04:11

sloze
Member
Registered: 2008-10-23
Posts: 1

Re: Error in mail message body encoding to utf-8 (solution)

Bonjour,

J'ai exactement le même problème, comment corriger cela ?

D'avance merci.

Hi,

I've exactly the same problem, How to fix this bug ?

Best regards.

Offline

#3 2008-10-23 17:32:14

MoYo
GLPI - Lead
From: Poitiers
Registered: 2004-09-13
Posts: 14,513
Website

Re: Error in mail message body encoding to utf-8 (solution)

Taras_ donne une solution. testez là et dites nous si cela fonctionne chez vous.


MoYo - Julien Dombre - Association INDEPNET
Contribute to GLPI :    Support     Contribute     References     Freshmeat

Offline

#4 2008-10-26 00:19:14

MoYo
GLPI - Lead
From: Poitiers
Registered: 2004-09-13
Posts: 14,513
Website

Re: Error in mail message body encoding to utf-8 (solution)


MoYo - Julien Dombre - Association INDEPNET
Contribute to GLPI :    Support     Contribute     References     Freshmeat

Offline

Board footer

Powered by FluxBB