tracker issue : CF-3712167

select a category, or use search below
(searches all categories and all time range)
Title:

<cfprocessingdirective> not implemented in CFScript

| View in Tracker

Status/Resolution/Reason: To Fix//

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 02/23/2014

Components: Language

Versions: 11.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: PublicBeta /

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Platforms All

Vote Count: 3

According to the docs here: https://wikidocs.adobe.com/wiki/display/coldfusionen/ColdFusion+Language+Enhancements#ColdFusionLanguageEnhancements-Scriptsupportfortags

This should work:

<cfscript>
// cfprocessingdirective.cfm
cfprocessingdirective(pageencoding="UTF-8");

week = ["R?hina", "R?t?", "R?apa", "R?pare", "R?mere", "R?horoi", "R?tapu"];
</cfscript>

However it errors with:
Invalid CFML construct found on line 4 at column 23.

ColdFusion was looking at the following text:
pageencoding

The CFML compiler was processing:

A script statement beginning with cfprocessingdirective on line 4, column 1.
A cfscript tag beginning on line 1, column 2.
 
The error occurred in C:/apps/adobe/ColdFusion/11beta/gettingstarted/cfusion/wwwroot/shared/scratch/blogExamples/coldfusion/CF11/codeForTickets/breakFromEach.cfm: line 4
2 : // breakFromEach.cfm
3 : 
4 : cfprocessingdirective(pageencoding="UTF-8");
5 : 
6 : week = ["RÄ?hina", "RÄ?tÅ«", "RÄ?apa", "RÄ?pare", "RÄ?mere", "RÄ?horoi", "RÄ?tapu"];

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3712167

External Customer Info:
External Company:  
External Customer Name: Adam Cameron.
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

cfprocessingdirective tag is a special tag and is handled differently because of which it is could not be supported as the generic script syntax of the tag. This tag is used to specify the template encoding. In Splendor, we are auto detecting the page encoding and hence most of the time it will not be required to set processingdirective.
Comment by Awdhesh K.
13294 | February 26, 2014 07:58:51 AM GMT
"most of the time" ain't good enough, Awdhesh. I've got a situation right now in which it is failing. The file is encoded with ISO-8859-5, and <cfprocessingdirective> enables it to correctly compile. But CF does *not* correctly detect it itself, and there's no way in CFScript I can tell it to. If you're going to do "100% CFScript coverage", you actually *have to do it*. Please reopen the ticket and sort it out. -- Adam
Comment by External U.
13295 | August 24, 2014 08:50:50 AM GMT
I agree, "most of the time" is not a good answer. The fact that Adam has a scenario which is not working correctly should be proof enough for that. I'll also add that Railo has no issues with this tag in script so I know it is technically possible.
Comment by External U.
13296 | August 24, 2014 03:09:34 PM GMT
Agree with Adam and Brad, sorry Adobe "most of the time" is not good enough.
Comment by External U.
13297 | August 24, 2014 03:13:19 PM GMT
There is a way to specify pageencoding in cfscript, try pageencoding "Cp1252" ;
Comment by External U.
13298 | September 04, 2014 09:51:45 AM GMT
Can you point us to the docs for that? That doesn't appear to match an existing function or tag so it doesn't seem very intuitive.
Comment by External U.
13299 | September 04, 2014 10:01:29 AM GMT
ChKumar... yeah, fine. In a CFC. Try it in a CFM.
Comment by External U.
13300 | September 04, 2014 10:02:14 AM GMT
Brad: https://wikidocs.adobe.com/wiki/display/coldfusionen/What+is+supported+in+CFScript#WhatissupportedinCFScript-pageencoding
Comment by External U.
13301 | September 04, 2014 10:05:26 AM GMT
Adam... Then that is a regression and should be fixed.
Comment by External U.
13302 | September 05, 2014 06:07:28 AM GMT
No it's not: it's just a very poor language design decision from your team: https://wikidocs.adobe.com/wiki/display/coldfusionen/Defining+components+and+functions+in+CFScript#DefiningcomponentsandfunctionsinCFScript-Specifyingpageencodingpageencoding {quote} Character encoding using pageencoding processing directive is not supported for CFM files. {quote} But it should be. Because it is stupid that it doesn't (as you seem to agree). However you better check with whoever made that decision before going fwd with this. Cheers, ChKumar
Comment by External U.
13303 | September 05, 2014 06:32:52 AM GMT
Can you please confirm in what version of ColdFusion this is going to be implemented in. It says "to fix" but does not say which version.
Comment by External U.
13304 | January 25, 2016 08:27:32 AM GMT
+1 - let's make CF2020 future-worthy
Vote by Aaron N.
27877 | May 19, 2018 06:09:26 AM GMT