Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
... but i don't want to include that on every include page..
But that is the recommended way to use it.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
yes
Copy link to clipboard
Copied
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...)
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
[this is a test]
Copy link to clipboard
Copied
[/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..
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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