Html::encode double encoding in page titles

I am using the Html::encode() method with page titles and it seems it is double-encoding, so I tried this:

Html::encode($str, false)

This is supposed to make sure it doesn’t double encode, but it doesn’t work!?

What’s up here?

Can you give an example of what you are passing into it and what is coming out?

I just passed some test data into it which contained a “&” (ampersand) and a “’” (single quote).

It seems though that the browser or server or what have you encodes it itself as I passed the code in normally and it still got encoded, but not double-encoded.

I don’t understand what you are saying now, is it working or not?

Send me an example string that you are passing into the function (not that you are passing ‘data’ which ‘contains’ an ‘ampersand’) and what is being echo’d out EXACTLY otherwise it is not really possible to understand the problem and help you.

Well it’s working without using the encode method. Code put into the page title seems to be automatically encoded somehow.

All good!