Copy link to clipboard
Copied
Hello,
When I send Coldfusion accentuated, it does not happen because of; ect...
Here is an example :
<meta http-equiv="Content-Type" content="text/html ; charset = utf-8 "/>
<body>
<CFOUTPUT>
<cfset mesx = "Nous avons collecté le maximum d'informations sur les golfs.<br>Nous n'avons pu, faute d'information et en particulier d'e-mail,… ">
mesx : #mesx#
</CFOUTPUT>
Here's the feedback :
Invalid CFML construct found on line 29 at column 67. | |
ColdFusion was looking at the following text: ; The CFML compiler was processing:
| |
The error occurred in \\192.168.0.1\H3637\zennetbuilder.com\Admin\EssaiD.cfm: line 29 | |
27 : <TR> 28 : 29 : <cfset mesx = "Nous avons collecté le maximum d'informations sur les golfs.<br> 30 : 576 : Nous n'avons pu, faute d'information et en particulier d'e-mail »> |
I'm not an experienced developer. If anyone can give me a clue!
Thank you
Mark
Copy link to clipboard
Copied
To use # as a character in a string, escape it by adding another #. Otherwise, ColdFusion thinks you wish to evaluate a variable.
<cfset mesx = "Nous avons collecté le maximum d&##39;informations sur les golfs.<br>Nous n&##39;avons pu, faute d&##39;information et en particulier d&##39;e-mail, ...">
<CFOUTPUT>
mesx : #mesx#
</CFOUTPUT>
Copy link to clipboard
Copied
Hello,
I do not understand your answer.
When it is entered: "Ceci est l'essai du jour", the system receives "Ceci est l'essai du jour." And because of ; It crashes.
Thank you for your help.
Cdlt
Copy link to clipboard
Copied
marcp12146864 wrote
Hello,
I do not understand your answer.
When it is entered: "Ceci est l'essai du jour", the system receives "Ceci est l'essai du jour." And because of ; It crashes.
It crashes not because of ; but because of #. That is a special character in ColdFusion. When it occurs in a string you should escape it by adding another #. Hence "Ceci est l&##39;essai du jour".
Copy link to clipboard
Copied
Hello,
That I understood well ;-)!
It's new ? Because until now I had not had this problem (but am a beginner)
But above all how to solve the problem with several programs?
Examples welcome
cordially
Copy link to clipboard
Copied
ZNB wrote
But above all how to solve the problem with several programs?
What do you mean? Please illustrate with code examples.
Copy link to clipboard
Copied
I guess if this happened 1 times, it can happen other times in other programs!
My code is simple:
Ceci est l'essai du 20 août 2017 |
Tank you
Copy link to clipboard
Copied
Assuming you have a recent version of ColdFusion, then use the canonicalize function.
Example
<cfprocessingdirective pageencoding="utf-8" >
<cfset testString ="Ceci est l'essai du 20 août 2017">
<cfoutput>
Test string: #testString#<br>
encodeForHTML(testString): #encodeForHTML(testString)#<br>
canonicalize(encodeForHTML(testString),false,false): #canonicalize(encodeForHTML(testString),false,false)#
</cfoutput>
Open the CFM page and view the source in the browser.
Copy link to clipboard
Copied
Je n'ai que la version 8
Copy link to clipboard
Copied
It is possible on ColdFusion 8! There is a workaround whereby you can call the canonicalize method on an encoder created from the ESAPI Java cl....