Question mark instead of € in mails

  • Posts: 14
  • Thank you received: 0
7 years 11 months ago #254621

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.4
-- PHP version -- : 7.0.7
-- Browser(s) name and version -- : Chrome 54.0

Hello,
I need help to solve a problem I had with mails in hikashop.

In ALL the notification mails the € symbol is replaced by a question mark.
As I set a custom layout for the mails I firstly thought that the problem was in my template. I reset the original one and the problem is already present.

I've also checked the Hikashop params and the setting is on UTF-8 (and base 64). The others special chars in my mails are correctly displayed (é, è, à, etc.).

Have you a suggestion?
Thanks in advance.

Please Log in or Create an account to join the conversation.

  • Posts: 82683
  • Thank you received: 13337
  • MODERATOR
7 years 11 months ago #254632

Hi,

It's indeed something relative to the character encoding of your emails. The charset you select in the HikaShop needs to be supported by your email server.
So if you selected UTF8 and you don't see the € symbol, it's probably that your email server doesn't support UTF8.
I would recommend to contact your hosting provider, as UTF8 is the most common charset used and it's not normal that the email server doesn't support it. Maybe you'll have to use the charset they will tell you (you can actually try others and see if that helps).
Or maybe changing the email server you're using. For example, if your configure your Joomla configuration to send emails with Gmail server instead of your hosting server, you should seee emails with the € properly displaying too.

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
7 years 11 months ago #254749

Hi Thank you for your answer.

I tried by Mailjet and By php mail and the result is the same.

So i created a plugin to test the mail with the event "onBeforeMailSend" and the problem is present before the sent.

Here is the code :

public function onBeforeMailSend(&$mail,&$mailer){
		echo "<textarea>";
		print_r ($mail);
		echo "</textarea>";
		die();
}

And the result is :

Thanks for your help.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82683
  • Thank you received: 13337
  • MODERATOR
7 years 11 months ago #254811

Hi,

That doesn't mean that the problem is with the email.
But yes, it could. For example, if you edited your currency via the menu System>Currencies and change the symbol to not use the UTF8 € symbol but something else.
Or if your web server is configured to display the pages in something else than UTF8 by default.

Also, there is no need to do a die like that. You can go in the menu Customers>Emails history of HikaShop and you'll get the data stored for each email sent by HikaShop. How does it look there ?

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
7 years 11 months ago #254812

Thanks for your answer.
In the email history it looks good. The mail I receive contains the problem but not in the mail history.

I don't understand, I tried with an external SMTP and a simple PHP function and the problem stay.

Please Log in or Create an account to join the conversation.

  • Posts: 82683
  • Thank you received: 13337
  • MODERATOR
7 years 11 months ago #254821

Hi,

In the backend of your website, the pages are displayed with UTF8. And the emails sent by HikaShop are sent in UTF8 (unless you changed the charset of the HikaShop configuration).
Did you try changing that charset setting ?

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
7 years 11 months ago #255282

Thanks for your answer. I tried all the settings in the hikashop backend,
the best is UTF-8 as everything is ok even the "é, à, è, etc." characters but not the "€".



I don't understand if when the page is shown in utf-8 how can I get this when I set a die in my backend?



Thanks for your help

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82683
  • Thank you received: 13337
  • MODERATOR
7 years 11 months ago #255285

Hi,

I don't know either. As you can see on our demo website, this never happens, not on our end, and not for everyone else. So I can only think that it is something relative to your server.
What you could try is to replace the symbol of the euro currency from € to € by editing the currency via the menu System>Currencies. That might be enough to circumvent the problem as it should normally display the same but the encoding/charset of the page won't affect the display of the HTML code.

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
7 years 11 months ago #255346

Thanks for your answer, I tried but it's not working.
I change the € symbol by EUR and for now it works.

I continue my investigation if I find something I'll let you now.

Please Log in or Create an account to join the conversation.

  • Posts: 82683
  • Thank you received: 13337
  • MODERATOR
7 years 11 months ago #255373

Hi,

Looking at my previous message, I see that it doesn't make sense as the symbol was automatically converted by the browser.
You should try using:

&euro;

Please Log in or Create an account to join the conversation.

Time to create page: 0.079 seconds
Powered by Kunena Forum