After installing the new ImageGen version (2.2.1.38932) I get the following error message when there is an URL encoded ampersand (%26) in the query: An error occurred while parsing EntityName. Line 1, position 14.
ImageGen 2.2 includes some changes to the way text is rendered, giving it more capabilities than before. One of the side-effects of these improvements is the need to url-encode the html-encoded text.
This is easier to explain with an example...
Let's say you want ImageGen to return an image with 'MEDIA & PRESS', so first you html-encode your string, which gives you:
?text=MEDIA & PRESS
And then you need to url-encode that string, which gives you:
?text=MEDIA+%26amp;+PRESS
Which will create the string output you're looking for.
The umbraco.library contains built-in functions for both html-encoding and url-encoding to automate this if you need it.
Ampersand gives me an EntityName error
After installing the new ImageGen version (2.2.1.38932) I get the following error message when there is an URL encoded ampersand (%26) in the query:
An error occurred while parsing EntityName. Line 1, position 14.
The original URL is:
http://localhost/umbraco/ImageGen.ashx?Text=MEDIA+%26+PRESS
All other special characters seems to be working fine.
Did I do anything wrong here?
Hi, Kalle,
ImageGen 2.2 includes some changes to the way text is rendered, giving it more capabilities than before. One of the side-effects of these improvements is the need to url-encode the html-encoded text.
This is easier to explain with an example...
Let's say you want ImageGen to return an image with 'MEDIA & PRESS', so first you html-encode your string, which gives you:
?text=MEDIA & PRESS
And then you need to url-encode that string, which gives you:
?text=MEDIA+%26amp;+PRESS
Which will create the string output you're looking for.
The umbraco.library contains built-in functions for both html-encoding and url-encoding to automate this if you need it.
cheers,
doug.
Works like a charm. Thank you!
is working on a reply...