• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

coldfusion et accentués ?

New Here ,
Aug 15, 2017 Aug 15, 2017

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

Views

448

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 15, 2017 Aug 15, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 17, 2017 Aug 17, 2017

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&#39;essai du jour." And because of ; It crashes.

Thank you for your help.
Cdlt

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2017 Aug 17, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 21, 2017 Aug 21, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 21, 2017 Aug 21, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 21, 2017 Aug 21, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 21, 2017 Aug 21, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 24, 2017 Aug 24, 2017

Copy link to clipboard

Copied

Je n'ai que la version 8

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 24, 2017 Aug 24, 2017

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation