[Resolved] E-mails and Voucher Image characters encoding problem


  • Default avatar
    armand    
     11 years ago
    0

    Emails generated are not UTF-8 encoded. This can be a problem for those using foreign languages.
    solved this by adding
    $mail->CharSet = 'UTF-8';

    before line 455 in awohelper.php

    I also have a problem with voucher images - the currency symbol is not correctly encoded (€) and 2 squares are displayed instead.

    Could you help please ?



  • Your avatar
    seyi    
     11 years ago
    0

    Hello,

    Thanks, we have made the change and it will be utf8 be default in the next version.

    For the euro currency symbol, I am not able to reproduce this problem, it shows up fine on the gift certificate image when testing. What version of prestashop are you using?
  • Default avatar
    armand    
     11 years ago
    0

    thanks for your reply

    I'm using 1.4.8.2
    Actually i'm not sure it's the euro symbol that is missing.
    On the voucher where there is USD on the preview i have those 2 squares.
    I can forward you the image at any email address if this helps.

    Also i am testing on Xampp on windows 7.
    Could it be a problem with that test platform ?

    update
    This is definitely a gd-imagettftext problem on some platforms
    http://stackoverflow.com/questions/9458317/working-with-gd-imagettftext-and-utf-8-characters
    http://stackoverflow.com/questions/198007/php-function-imagettftext-and-unicode

    I tried multiple solutions based on those reading
    and finally i found that adding after line 387 in awohelper.php :

    $text = mb_encode_numericentity($text, array (0x0, 0xffff, 0, 0xffff), 'UTF-8');


    fixed the problem for me.

    I would like to have your input on this fix please.




  • Your avatar
    seyi    
     11 years ago
    0

    I did run some tests on the solution you laid out. I added the euro sign to the preview examples you receive when you are on the profile list and click preview. Tried it with the code and without. Without the code, it seems the euro sign is stripped out, with the code it is just a square block. Progress, but dont understand why its not producing the character on the preview, even though I get it just fine through email.