Encoding problem

gpstefanov

New Member
Hello,

I have the following problem. My template is in cyrillic. Everything works fine until I try to add Google UTM tags to the links.

When the system parses the links with the tags instead of the ciryllic text I see strange symbols. Any idea what is wrong and how to fix it?

Here is an example:

Before parsing:
upload_2015-10-29_16-29-46.png

After parsing the links:
upload_2015-10-29_16-29-17.png
 
This looks messed up big time.
Do you think you can attach the html template and the utm pattern so that i try it on my end?
 
Sure! Here is the attached code straight from MailWizz.

The utm tags are ?utm_source=newsletter&utm_medium=newsletter&utm_term=newsletter&utm_content=newsletter&utm_campaign=newsletter

I have tried with many others but the result is the same.
 

Attachments

Well this is actually the code before it gets broken. :)

We think the problem might be coming from this:

In order to get the template in working order when sent to the API we had to add this in /apps/api/controllers/TemplatesController.php
on line 158:
Code:
if(isset($attributes['content'])) {
   $attributes['content'] = @base64_decode($attributes['content']);
}

Without it we see the template like this:
Screen Shot 2015-10-29 at 18.29.05.png
So we think the problem might be coming from the base64_decode but we're not 100% sure. :)
 
Last edited:
Ok, so here there are a few things you didn't tell me about, for example the fact this templates comes from an api call.
How does your api call looks like? Because the templates endpoint will base64_decode the content as line ~225 in same file shows:
PHP:
$template->content = $parser->setContent(@base64_decode($attributes['content']))->getContent();
Now, what you have attached is completely broken template, that cannot be used. I assume that when you upload it via the API it isn't broken?
If you upload the template normally via the web interface, does it upload as it should, without special and weird chars showing all around ?
 
I'm sorry for taking me that long to reply.

To answer your questions:
Yes when uploaded via API the template works fine.
I haven't tried to upload it thorough the web interface, but I assume it will broken and with weird symbols all over.

My developers managed to fix the problem (I haven't heard back from them how).

It will be great for four future customers, who are using the system the same way as me, to look into the cyrillic encoding and to fix it.
Obviously we had to rewrite a couple of things to get the system work properly.

Anyway thanks for the time you spent looking into the problem.

BTW Other than this issue the system works great so far!
 
My developers managed to fix the problem (I haven't heard back from them how).
Maybe we can get ahold of the changes? Think that next time when you update your app, all these changes will vanish, that's why it's okay to add them in the app core.

It will be great for four future customers, who are using the system the same way as me, to look into the cyrillic encoding and to fix it.
We're working on this(any help is appreciated for issues caused by this), for example email addresses with special chars in them are a problem in current 1.3.5.8 version but have been fixed in 1.3.5.9.
 
Back
Top