[solved] PDF Reports - Charset Problem


(jOoL) #1

Hello,
The charset is problematic in my pdf reports.
Accents are not displayed correctly:

How can I solve this please ?


#2

[quote=jOoL]
Hello,
The charset is problematic in my pdf reports.
Accents are not displayed correctly:

How can I solve this please ?[/quote]

I am getting the same problem the the charset. I wold love to know the answer. Thanks, Byron.


(Matthieu Aubry) #3

Hi

is it new in 1.2 , or did you have the problem in 1.1.1 as well?


(jOoL) #4

[quote=matt]
Hi

is it new in 1.2 , or did you have the problem in 1.1.1 as well?[/quote]

Hi, I had the problem in 1.1.1 as well.


(Matthieu Aubry) #5

What charset is your website using? can you put your page URL with some buggy name so I can see the request to piwik?


(jOoL) #6

[quote=matt]
What charset is your website using? [/quote]
iso-8859-1"

[quote=matt]
can you put your page URL with some buggy name so I can see the request to piwik?[/quote]
http://www.cailler-electromenager.ch/contacts.html?message=S�che-linge+Miele%2C+s�rie+4000+-+T+48-39+C+CH#contact

Thanks
jOoL


(vipsoft) #7

i’ll open a ticket. I don’t think we handled charset/encoding conversion for page titles. (We do for search engine keywords.)


(jOoL) #8

Thanks a lot !


(vipsoft) #9

This should now be fixed in http://dev.piwik.org/trac/changeset/4080

Note: it won’t convert page titles already recorded/archived.

(Edit: That didn’t fix it. Ticket sanitizeInputValue() - improvements · Issue #2185 · matomo-org/matomo · GitHub has been re-opened for reinvestigation.)


(vipsoft) #10

JOol: are you using the PiwikTracker class to track those contact URLs?


(jOoL) #11

I use standard JS script:


(vipsoft) #12

Oh, I see.

We can’t fix this because piwik.js already encodes the action name (using %xx for special chars). Your example results in double encoding because you’re passing in a URL that’s already encoded.

You should use unescape() or decodeURIComponent() first, e.g.,


// depending on the URL:
piwikTracker.setDocumentTitle(unescape( url ));
// or
piwikTracker.setDocumentTitle(decodeURIComponent( url ));

These forms would work:


// \x - followed by hexits
piwikTracker.setDocumentTitle("/contacts.html?message=S\xE8chelinge+Miele\x2C+s\xE9rie+4000+-+T+48-39+C+CH" ) ;

// html entity code , &# decimal ;
piwikTracker.setDocumentTitle("/contacts.html?message=Sèche-linge+Miele,+s&#%233;rie+4000+-+T+48-39+C+CH" ) ;

// or UTF-8
piwikTracker.setDocumentTitle("/contacts.html?message=Sèche-linge+Miele,+série+4000+-+T+48-39+C+CH"  );

(jOoL) #13

Thanks I used


piwikTracker.setDocumentTitle(unescape( url ));

and it works now.

Not the other solution.

Thanks a lot!