URLEncodedFormat ISO8859 ou UTF8

101 views
Skip to first unread message

Pierre Larde

unread,
Sep 22, 2016, 7:58:40 AM9/22/16
to Lucee
After migration from Coldfusion to Luccee,
I have a problem in the rendered value of URLEncodedFormat

Under Coldfusion I had an ISO url code (%E9 )
Under Lucee I have a UTF8 url code. (becomes : %A9 )

Files code have not been modified, just a copy.
Why this change ?
How to fix this ?

I have these code lined in the application.cfm :
<cfprocessingdirective pageEncoding="iso-8859-1">
<cfcontent type="text/html; charset=iso-8859-1">
<cfset setEncoding("URL", "iso-8859-1")>
<cfset setEncoding("FORM", "iso-8859-1")>

Thanks for help.
Pierre.

Nando Breiter

unread,
Sep 22, 2016, 10:19:57 AM9/22/16
to lu...@googlegroups.com
Try putting <cfprocessingdirective pageEncoding="iso-8859-1"> on the template that is giving you the problem. It may be that each template is compiled using utf-8 on lucee unless a cfprocessingdirective on that template indicates otherwise.




Aria Media Sagl
+41 (0)76 303 4477 cell
skype: ariamedia

--
Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/bbba0838-b90a-4b77-9415-3721c2c28531%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pierre Larde

unread,
Sep 22, 2016, 11:37:17 AM9/22/16
to Lucee
No, I tried it  : no change.
It did work Under Coldfusion.
It seems that URLEncodedFormat  always render under UTF8 with Lucee ?
(even if ISO-8859 is required) 
Only that function URLEncodedFormat does that.
Rest of page is correct ISO-8859.

andreas

unread,
Sep 22, 2016, 2:28:33 PM9/22/16
to lu...@googlegroups.com

did you set page encoding in the lucee server-/webadmin also?


--
Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Nando Breiter

unread,
Sep 22, 2016, 2:41:54 PM9/22/16
to lu...@googlegroups.com
Pierre,

As far as I understand, if your text is hard coded on a template in iso-8859-1, you'd need the cfprocessingdirective tag on each template that has such text on it. 

If the text is output from a database via a datasource, then it may be necessary to set the correct connection string on the datasource to ensure the database driver handles the encoding correctly. 

If your database happens to be MySql, converting tables and fields from iso-8859-1 is simple and straightforward to do. I can share some code I've used in the past to do this, or I'm sure you could figure this out with a few quick searches on the interwebs.



Aria Media Sagl
+41 (0)76 303 4477 cell
skype: ariamedia

Pierre Larde

unread,
Sep 23, 2016, 5:47:06 AM9/23/16
to Lucee
I added the iso-8859-1 in the Lucee admin server charset. (as default)
Same result

And, from the database, the field value render correctly if it is displayed in the page (iso-8859-1)
and get an utf-8 value if it is rendered Inside the URLencodedFormat
Then this does not come from the database or the datasource.

<a href='affichage_ville.cfm?ville=#URLEncodedFormat(p_ville)#' class='hi_bleu_2'>- #p_ville#</a><br>

ville=#URLEncodedFormat(p_ville)#'   is displayed in UTF-8
and
- #p_ville#  is displayed in  iso-8859-1

It seems, there is a problem with the URLEncodeFormat function.
It always render in UTF-8

Thanks for any help, this is a point where I will have to go back to Coldfusion if no solution.
Thanks to all.
Pierre.


Le jeudi 22 septembre 2016 13:58:40 UTC+2, Pierre Larde a écrit :

Julian Halliwell

unread,
Sep 23, 2016, 6:39:16 AM9/23/16
to lu...@googlegroups.com
Try this:

ville=#UrlEncode( p_ville, "iso-8859-1" )#

Pierre Larde

unread,
Sep 23, 2016, 8:01:30 AM9/23/16
to Lucee
OK, thanks very much, it does work.
Then I understand that in Lucee URLencode is UTF-8 as default.
to get ISO, that must be added in the function.

Which is a little bit different Under Coldfusion, as it takes the default of the page.

Pierre.


Le jeudi 22 septembre 2016 13:58:40 UTC+2, Pierre Larde a écrit :
Reply all
Reply to author
Forward
0 new messages