Previous Thread
Next Thread
Print Thread
Hop To
Joined: Feb 2016
Posts: 6
Likes: 2
M
Stranger
Stranger
M Offline
Joined: Feb 2016
Posts: 6
Likes: 2
Hi,
I've just upgraded from UBB 7.7.5 to UBB 8.0.0 and PHP 7.x to PHP 8.3 and noticed that e-mails now appear have an incorrect character encoding: unicode characters such as πŸ†or typographic quotes (β€œ) are received using the wrong encoding. This has been verified on multiple receivers using different mail clients. Before the upgrade, those characters showed up properly in the e-mail.

Subject: both emoji and typographical characters are encoded incorrectly.
Body: only the emoji characters are encoded incorrectly. (I couldn't yet verify if the typographical one might just get HTML-escaped.)

I tested this with both regular threads and with the sendmail test feature in the board's config. The database is utf8mb4 enabled, utf8 is enabled in the config.inc.php. Do you have any recommendations what else I should look into? My next approach would be to scour the relevant source code files if I find something that leads me in the right direction but helpful hints are always appreciated!

Many thanks, Michael

1 member likes this: isaac
Joined: Apr 2004
Posts: 2,027
Likes: 175
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 2,027
Likes: 175
Thank you. I've looked in to this and found what is causing the issue.

PHPmailer attempts multiple strategies so it works even when the mbstring extension is disabled. It defaults to ISO-8859-1 for backward compatibility. But since we're already setting the CharSet to UTF8 in the CP and a requirement for UBB.threads is the mbstring library being available, the fix is to set PHPmailer's CharSet variable to UBBT.thread's when UTF8 is enabled in the forums.

in /libs/mailer.inc.php around line 330
FIND:
Code
			// Create a html body and text body in parallel

REPLACE WITH:
Code
			// CharSet: The character set of the message
			// The target charset to convert to, defaults to ISO-8859-1 for BC
			if ($config['UTF8'] != '') {
				$this->CharSet = 'UTF-8';
			}

			// Create a html body and text body in parallel

you can manually apply this modification to your forums now, or wait until the next version of UBB.threads is released when it will be included.


current developer of UBB.threads php forum software
current release: UBB.threads 8.0.1 // wip: UBB.threads 8.1.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Feb 2016
Posts: 6
Likes: 2
M
Stranger
Stranger
M Offline
Joined: Feb 2016
Posts: 6
Likes: 2
Hi issac,
thank you so much for the quick and proficient response. I applied the patch and verified that I receive properly encoded unicode characters via e-mail. You saved me some precious hours of my life here smile

Best regards, Michael

1 member likes this: isaac

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Can no longer log in as admin or user
by maria - 01/10/2026 11:00 AM
E-Mail & Unicode / UTF8 encoding problems
by Michael_E6D9 - 01/08/2026 2:14 AM
Upgrading from 7.7.5 to 8.0.1
by Morgan - 01/07/2026 5:25 AM
Take this for what it's worth
by Baldeagle - 12/26/2025 6:00 PM
innodb_buffer_pool_s
ize = 8G

by Baldeagle - 12/25/2025 3:32 PM
Who's Online Now
1 members (1 invisible), 5,606 guests, and 221 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
test
test
by Gizmo, August 20
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)