//richinternet.blog

Viewing By Entry / Main
Wednesday, June 10, 2009
CFLOOP: undocumented charset attribute for reading files

ColdFusion 8 introduced a new feature which allows to use CFLOOP to read in a file line by line. This is a nice convenience method but I noticed that by default CFLOOP in this mode always uses iso-8859-1 encoding to read the file's content which of course causes trouble when the encoding of the file is e.g. utf-8. By accident I found that there's an undocumented attribute on the CFLOOP tag to set the charset to use when reading in a file:

<cfloop file="#path#" index="line" charset="utf-8">
...
</cfloop>

Dirk.

Comments

Nice catch / find with the undocumented feature. Be careful, though -- if you rely on this and CF pulls this argument or changes it, you application will likely break.

You should reach out to Adam Lehman (@adrocknaphobia on Twitter) and give him a heads up about this. Who knows, you might get the argument introduced in CF9.

I'm curious; does anyone know if Railo or OpenBSD supports this feature?




Sun Mon Tue Wed Thu Fri Sat
   1234
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30   

About this blog
www.richinternet.de

AIR (9)
Apollo (3)
BlazeDS (8)
Breeze (1)
Central (5)
ColdFusion (54)
Flash (57)
Flash Media Server (6)
Flex (160)
Flex Trace Panel (6)
FXUG (3)
J2Flex (4)
MAX (31)
Mobile (1)
mxmlc (1)
Other topics (42)
Plugins (5)
Video (4)

Copy Fully Qualified Classname Plugin for Flash Builder 4 (CFQCN)

Recent Flex Technotes
Recent ColdFusion Technotes
Recent Flash Technotes

http://www.flexperten.de
http://www.flexforum.de
http://www.flex.org
http://www.bloginblack.de
http://www.cflex.net
flexcoders mailing-list
flexcoders archive
more links...

Aggregated by fullasagoog.com
Aggregated by MXNA

Short Mode | Full Mode

Herrlich & Ramuschkat