The Railo <cfloop file="..."> tag is clearly intended to support a charset="..." attribute because it says as much in the error message if an illegal attribute is used.
If I use cfloop to read lines from a UTF-8 encoded file with no charset attribute then it works correctly but I don't know why. I would prefer to be explicit and state charset="utf-8" but I am not sure that this has any effect.
The reason for this is that I would expect that explicitly stating charset="windows-1252" or charset="iso-8859-1" would break the input from a UTF-8 encoded file but instead it continues to work correctly. It seems that charset="..." does not cause an error but neither does it have any effect.
I am left wondering whether the correct parsing of UTF-8 with no explicit charset will continue to work tomorrow or on another machine.
Is UTF-8 the default encoding for cfloop? If not, is it possible to ensure that UTF-8 encoding will be used?
Solutions that don't involve changing the default JVM file.encoding property would be preferred.
I have resolved this after digging through the Railo source. The charset attribute is not (usually) ignored. The UTF-8 file I was using had a Byte Order Mark (BOM) even though I had explicitly requested that my editor save it without one. It turns out that the charset attribute is ignored if there is a BOM and this is not entirely unreasonable behaviour.
If the BOM is missing then the charset="utf-8" attribute will ensure that the correct default encoding is used regardless of the setting of the System.file.encoding property.