VicenteJHGA
VicenteJHGA

Reputation: 53

Why coldfusion is replacing 'é' by '?' when I read from URL

In my server I have an instruction like writeDump(URL.vehicle), and in my URL I have something like myweb.co.uk?vehicle=Coupé, but in my code I get Coup?, does somebody know why is happening it and how can I solve it?

Thanks for your help

Upvotes: 1

Views: 97

Answers (1)

James A Mohler
James A Mohler

Reputation: 11120

In older versions of ColdFusion

Try using URLEndodedFormat()

 <a href="myweb.co.uk?vehicle=#URLEncodedFormat(url.vehicle)#">...

https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-t-z/urlencodedformat.html

In ColdFusion 11 or higher

Try using EncodeForURL()

 <a href="myweb.co.uk?vehicle=#EncodeForURL(url.vehicle)#">...

https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-e-g/encodeforurl.html

Either one of these will escape out any special characters

Upvotes: 2

Related Questions