Best practice forum (Archived)

Certificate utf-8 encoding bug

 
??
Certificate utf-8 encoding bug
?? 发表于 2013年04月17日 Wednesday 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
AngusGeorge 发表于 2013年04月17日 Wednesday 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.

LewisNathan
Re: Certificate utf-8 encoding bug
LewisNathan 发表于 2013年05月9日 Thursday 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