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: 23 Apr 2018, 12:18

Problem with polish national characters after parse

Post by Joterini »

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 543 times
parsed_msg_1524486304_b06456078fcfa27446740b006021ae21.txt
(5.46 KiB) Downloaded 553 times
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Problem with polish national characters after parse

Post by SL-Gundam »

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: 23 Apr 2018, 12:18

Re: Problem with polish national characters after parse

Post by Joterini »

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 8556 times
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Problem with polish national characters after parse

Post by SL-Gundam »

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: 23 Apr 2018, 12:18

Re: Problem with polish national characters after parse

Post by Joterini »

Thanks a lot! I modify core.php file as in Mantis bug tracker and everything is ok.
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Problem with polish national characters after parse

Post by SL-Gundam »

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