Thank you very much, Matt, that was it. There was indeed a redirect which I overlooked before, and that did the double encoding. Everything works fine now.
There is, however, something that looks like a little bug to me.
The site is reacheable via two domains, say example-site.com and examplesite.com. There is this redirect from examplesite to example-site that caused the problem. When I look in Piwik at settings / websites, there is only one, namely example-site.com. That is ok, except when I click on View Tracking Code, there is the code with examplesite.com in it.
I might have installed Piwik by calling the Piwik installation from examplesite.com - This website is for sale! - example site Resources and Information. (I don’t remember), but now nowhere in the settings is any trace of examplesite.com, except in the tracking code, where I can’t get rid of it.
It is not a problem for me any longer, I just modified the tracking code in the Drupal template, but there seems to be some inconsistency within the Piwik settings.