Best practice forum (Archived)

Certificate utf-8 encoding bug

 
Michael Trio
Certificate utf-8 encoding bug
by Michael Trio - Wednesday, 17 April 2013, 12:39 PM
Group Partners

Hello -

 

I've come across an interesting character  encoding error in 2.2.17 that only seems to affect certificate generation, specifically the name of a displayed grade item.

1.) Create a quiz with a name with an EM dash (—, or Alt+0151)

2.) Create a certificate that prints the grade of the quiz you created in step 1

3.) Generate the certificate

Result:  The '—' displays as '?'

Expected: The '—' displays as '—'

 

I attached a proposed patch for this, which removes a call to the function utf8_decode that is used when generating the grade activity name.  It seems to work now, but is this going to cause something else to go pear-shaped, or is this a legitimate fix?

 

Thanks,

Michael

me
Re: Certificate utf-8 encoding bug
by George Angus - Wednesday, 17 April 2013, 8:40 PM
Group Totara

Hi Michael,

Thanks for bringing this to our attention, and filed a bug report and brought your suggested code to the attention of the devs.

regards,

George.

Nathan Lewis
Re: Certificate utf-8 encoding bug
by Nathan Lewis - Thursday, 9 May 2013, 3:52 PM
Group Totara

Hi Michael.

I've written a patch which includes the change you suggested as well as other fixes for character encoding issues in certificate pdfs. It's currently in testing and hopefully will be included in the next releases of Totara 2.2 and 2.4.

Nathan