Best practice forum (Archived)

Certificate utf-8 encoding bug

 
? ?
Certificate utf-8 encoding bug
על ידי ? ? בתאריך 17/04/2013, 12:39
 

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
על ידי George Angus בתאריך 17/04/2013, 20:40
קבוצה 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
על ידי Nathan Lewis בתאריך 9/05/2013, 15:52
קבוצה 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