Arabic date not displaying correctly

Arabic date not displaying correctly

by Nicola Bennett -
Number of replies: 5

Hello,

I am using the certificate module on a course which has the language set to Arabic.

I have translated the certificate.php file into Arabic but this doesn't contain the month names.

On the certificate the month is displaying incorrectly as square characters (please see attached file).

What do I need to do to correct this?

Thanks in advance
Nicola.

Attachment cert_date.jpg
Average of ratings: -
In reply to Nicola Bennett

Re: Arabic date not displaying correctly

by Raymond Fürst -
Hi Nicola,

does this problem also occur when the user dateformat option is picked? All other options seem to be fixed english date formats (hardcoded in the type definitions.)

Maybe changing the line:

cert_printtext( ... , $certificatedate);

into:

cert_printtext( ... , utf8_encode($certificatedate));

in the file
mod/certificate/type/unicode_landscape/certificate.php
might work.

I had some problems with umlaut characters in some text bits that are displayed correctly after this trick.
In reply to Raymond Fürst

Re: Arabic date not displaying correctly

by Nicola Bennett -

Thanks Raymond, the problem was occuring with the user dateformat option selected.

Although I think you're right it is an encoding issue. I tried your solution but it then displayed a different set of characters. I've passed it on to a colleague who knows more about encoding, so hopefully he will solve it and I'll post the solution.

Thanks very much for the lead.

In reply to Nicola Bennett

Re: Arabic date not displaying correctly

by Raymond Fürst -
Hi Nicola,

have you tried utf8_decode() instead of utf8_encode() ?

Does the date show correctly when listed in the certificate report?
In reply to Raymond Fürst

Re: Arabic date not displaying correctly

by Nicola Bennett -

Hi Raymond,

I tried decode but question marks (?????) now display instead of the squares.

The date displays correctly in the certificate report.

Any other suggestions would be greatly appreciated.

Thanks

In reply to Nicola Bennett

Re: Arabic date not displaying correctly

by deepti pulavarthi -

Hi Nicola,

 

I am trying to convert certificate.php into arabic and haven't been able to get it to display arabic in the certificate. Would you mind sharing your file?

 

Thank you
Deepti