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

application wide page encoding?

New Here ,
Nov 10, 2009 Nov 10, 2009

I have found that you are able to change the page encoding for the entire server, but Is there a way to set the page encoding for an entire application? Using cfprocessingdirective works but i don't want to include that on every include page... any help would be appreciated

1.3K
Translate
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 ,
Nov 10, 2009 Nov 10, 2009
... but i don't want to include that on every include page..

But that is the recommended way to use it.

Translate
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 ,
Nov 10, 2009 Nov 10, 2009

it seems like you should be able to set the encoding per application so you can have websites in different languages and different encodings without having to include that tag on every single include

Translate
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
Valorous Hero ,
Nov 10, 2009 Nov 10, 2009

Are you looking for some other solution, other then the Application.cfm|cfc files that are automatically included in every request and thus can provide common code application wide or directory wide sections of an application?

Translate
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 ,
Nov 10, 2009 Nov 10, 2009

cfprocessingdirective doesn't apply to included pages... so if i put it in the Application.cfc it doesn't really apply to anything because I include everything from that point

Translate
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
LEGEND ,
Nov 10, 2009 Nov 10, 2009

Are you looking for some other solution, other then the Application.cfm|cfc files that are automatically included in every request and thus can provide common code application wide or directory wide sections of an application?

Translate
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 ,
Nov 10, 2009 Nov 10, 2009

yes

Translate
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
LEGEND ,
Nov 10, 2009 Nov 10, 2009

Are you looking for some other solution, other then the Application.cfm|cfc files that are automatically included in every request and thus can provide common code application wide or directory wide sections of an application?

<cfprocessingdirective> in this case might better be called <cfcompilerdirective> as the page encoding is a compile-time consideration.  There's no concept of a "request" (or onRequestStart, or Application.cfc or anything like that) going on when a file is compiled, so every file needs the setting.

--

Adam

(let's see if my comment actually posts this time...)

Translate
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 ,
Nov 10, 2009 Nov 10, 2009

that was what i was afraid of... do you know if there is something i can do in IIS or Coldfusion itself to change the encoding for just one site?

Translate
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
Engaged ,
Nov 15, 2009 Nov 15, 2009

Hmm, I wonder if cfcompile.bat could/should be updated to accept a pageEncoding argument?

<cfscript>

  compile(directoryToCompile, pageEncoding);
</cfscript>

Of course 'compile' is, not yet, a built-in function =P

For anyone interested, the built-in compile function is ER #78859: http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=78859

-Aaron Neff

Translate
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
Engaged ,
Nov 15, 2009 Nov 15, 2009

OK, that took a few tries to post, before I realized I'm apparently unable to use square brackets in a post?  Let's try this again: [ ]  ..if this works, then I have no idea what the issue was before.  Every time I'd try to post, a JS prompt would appear, alerting me that I have unsaved changes.  If I chose 'continue', then it would fail to post my message.. instead, it would display a blank comment box (and display an error that I'm not allowed to post an empty message).  It wasn't until I removed the square brackets that I was able to get my message to post.

Translate
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
Engaged ,
Nov 15, 2009 Nov 15, 2009

[this is a test]

Translate
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
Engaged ,
Nov 15, 2009 Nov 15, 2009
LATEST

[/code][code]

Aha! That was the culprit..  If I switch those two around, then my post fails.  So apparently these forums don't like this:

(code)
<cfscript>

  compile(directoryToCompile, pageEncoding);
</cfscript>

(/code)

..where ")" indicates "]", and "(" indicates "["

..now on to something more interesting..

Translate
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
Enthusiast ,
Nov 10, 2009 Nov 10, 2009

why on earth would you want to do that? most folks want only one encoding,

unicode. applications w/multiple codepages are like living in a cave w/out the

knowledge of fire...bad.

you can have as many languages/locales as you want or can support using unicode

(that's why it was created). if you have a language that unicode doesn't

support, call SETI, you've probably discovered aliens.

the cost of converting to unicode is nothing compared to having to manage

multiple encodings long term. trust me on this.

Translate
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
LEGEND ,
Nov 10, 2009 Nov 10, 2009

I have found that you are able to change the page encoding for the entire server, but Is there a way to set the page encoding for an entire application? Using cfprocessingdirective works but i don't want to include that on every include page... any help would be appreciated

Do you have a requirement for apps on the same server to have different character encodings?

--

Adam

Translate
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