Problem with polish national characters after parse

This plugin allows you to report an issue in MantisBT by sending an email to a particular mail account

Moderators: Developer, Contributor

Post Reply
Joterini
Posts: 4
Joined: Apr 23, 2018 7:18 am

Problem with polish national characters after parse

Post by Joterini » Apr 23, 2018 7:38 am

Hi. i`m trying to configure email reporting. Everything works fine but i have problem with email content witch contains polish national characters.
I enabled debuging and see that raw_msg_id - format of email is ok, there where all polish chars. But in second file parsed_mgs_id polish chars are replaced by ??? chars.
Can You help me, where can be a problem? I attached two files (raw and parsed same message).
Additionaly, when i`m adding new issue or comment via mantis interface everythig is ok, email with notification also are good (contans polish national chars)
Thank You for any hint.
Attachments
raw_msg_1524486304_37ae799bc9a78fec02106296e3c23fb8.txt
(4.83 KiB) Downloaded 122 times
parsed_msg_1524486304_b06456078fcfa27446740b006021ae21.txt
(5.46 KiB) Downloaded 121 times

SL-Gundam
Posts: 567
Joined: Jul 06, 2011 9:17 am

Re: Problem with polish national characters after parse

Post by SL-Gundam » Apr 23, 2018 8:23 pm

What version of MantisBT are your running
What version of EmailReporting are your running?
What version of PHP are you using?
MBstring extension for PHP is required for proper charset conversion. I believe MantisBT 2.12 and newer or something requires MBstring as well to function

Joterini
Posts: 4
Joined: Apr 23, 2018 7:18 am

Re: Problem with polish national characters after parse

Post by Joterini » Apr 24, 2018 11:00 am

Hi, thanks for reply.

I`m using Mantis ver. 2.13.1 with Email Reporting v 0.10.0 and PHP 5.5.9
MBstring extension seems to be enabled, as in attachment.

When i edit Parser.php file and comment line 426 email body looks ok.

_______ EDIT____

The problem seems to be with

Code: Select all

$this->_encoding = mb_internal_encoding();
After debuging it return ISO-8859-1 but should return utf-8, when i manualy change line 139 to

Code: Select all

$t_encode = mb_convert_encoding( $encode, 'utf-8', $this->_mb_list_encodings[ strtolower( $charset ) ] );
Everything looks fine.
Attachments
mbstrings.png
mbstrings.png (26.92 KiB) Viewed 1917 times

SL-Gundam
Posts: 567
Joined: Jul 06, 2011 9:17 am

Re: Problem with polish national characters after parse

Post by SL-Gundam » Apr 24, 2018 12:42 pm

MantisBT team has made mbstring a requirement. This has resulted in them deleting this utf-8 folder
https://github.com/mantisbt/mantisbt/tr ... brary/utf8
https://github.com/mantisbt/mantisbt/tr ... 13/library

I believe this has resulted in the loss of some important code since this line is now not being executed anywhere in MantisBT
https://github.com/mantisbt/mantisbt/bl ... f8.php#L41

I will create a issue in the MantisBT bug tracker and will see what they say


Joterini
Posts: 4
Joined: Apr 23, 2018 7:18 am

Re: Problem with polish national characters after parse

Post by Joterini » Apr 25, 2018 10:39 am

Thanks a lot! I modify core.php file as in Mantis bug tracker and everything is ok.

SL-Gundam
Posts: 567
Joined: Jul 06, 2011 9:17 am

Re: Problem with polish national characters after parse

Post by SL-Gundam » Apr 25, 2018 12:53 pm

Good to hear that the issue has been resolved

I advise you to upgrade to 0.10.0-DEV for the following changes
https://github.com/mantisbt-plugins/Ema ... 1bec8b080f
https://github.com/mantisbt-plugins/Ema ... 1483a16cc8

Post Reply