-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Having trouble with UTF-8 special characters #56
Comments
The form is here, if you want to try adding the accept-encoding attribute: src\tmpl\main.tmpl.html My users always create contents in UTF-8 and it works fine, but the encoded chars are not in the template, but in their content (but this is submitted all together by mosaico in the same post, so I guess it is something else) If you want to deal with UTF-8 the backend must use the mb* string functions and not the usual string functions. You can use the network tab in your Chrome to see if the content posted by mosaico.io has the same encoding of the content posted to your own website. |
I tried with html entities in the template, but got the same result. I want to work in UTF-8 at all. In chrome network tab, the content posted by mosaico looks not very different than the one from my own website: my site: it says that the value of html cannot be decoded even if the request header looks the same. mosaico.io: the value of html is visible |
Make sure you apache is configured to default to utf8 and you php is configured to use utf8. |
Chrome says that it cannot decode the value of Html - Field in the request. This made me think, that the issue is not on the server side. this is from my phpinfo. Could this be the problem?
iconv.input_encoding ISO-8859-1 ISO-8859-1 |
It appears to me that I need in editor.html: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> or <meta charset="utf-8" /> more detailes in http://stackoverflow.com/questions/4696499/meta-charset-utf-8-vs-meta-http-equiv-content-type as InlineStyle uses PHP DOMDocument, i will take the long version for now. I propose to add this line in mosacio as well. |
So, if I understand it correctly, this is needed when the web server does not default to UTF-8 when publishing contents (As I don't see any change in Node.js and on my "default" Apache Httpd 2.4 deployment. |
This is how I understand it. I tested it on three different Apache Installations (one of it was a out of the box Bitname mamp stack). I could not even find out what the default setting was. One comment on stackoverflow said, that Apache configuration needs to be set to UTF-8 in order to make the <meta ... change work. But all the three sytems the change fixed the problem of this issue. Thanks for changing it in your distribution. |
* feature/Integrate_Inlinestyle: Added <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> see voidlabs/mosaico#56 Integrate https://github.com/christiaan/InlineStyle Updated readme.md accordingly. Ignore generated files in this repository.
If the template or my email contains special characters such as öäü ® etc. the HTML string delivered to the backend has wrong encoding. This happens regardless if the template has the special characters or if the email author entered these.
It is hard for me to find out, where the issue comes from:
Wherever it is, If I observe the HTML in a php debugger (intelliJ Idea), the special characters are show as
���
I tried with mosaico.io, but there it works.
Any hint is welcome.
The text was updated successfully, but these errors were encountered: