Skip to main content
marcp12146864
Known Participant
August 15, 2017
Question

coldfusion et accentués ?

  • August 15, 2017
  • 1 reply
  • 699 views

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&eacute; 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,… ">
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:

  • An expression that began on line 29, column 64.
    The expression might be missing an ending #, for example, #expr instead of #expr#.
  • An expression beginning with \", on line 29, column 23.This message is usually caused by a problem in the expressions structure.
  • A cfset tag beginning on line 29, column 10.

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&eacute; le maximum d&#39;informations sur les golfs.<br>

30 : 576 : Nous n&#39;avons pu, faute d&#39;information et en particulier d&#39;e-mail »>

I'm not an experienced developer. If anyone can give me a clue!
Thank you
Mark

This topic has been closed for replies.

1 reply

BKBK
Community Expert
Community Expert
August 15, 2017

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&eacute; 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>

marcp12146864
Known Participant
August 17, 2017

Hello,


I do not understand your answer.
When it is entered: "Ceci est l'essai du jour", the system receives "Ceci est l&#39;essai du jour." And because of ; It crashes.

Thank you for your help.
Cdlt

BKBK
Community Expert
Community Expert
August 17, 2017

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&#39;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".