ColdFusion, CFDirectory and the French

530 views Asked by At

We have a ColdFusion file library management system that is being taken off an old ColdFusion 4 server and moved onto the new system which is based on ColdFusion 8.

All our files and folders are in English, French and Spanish.

Using CFDirectory in CF8 to load and display these files and folders is causing two issues with the French and Spanish files and folders, but the two problems are probably linked.

  1. Directories with accented characters are not being returned from the cfdirectory.
  2. Files with accented characters are displaying with an upside down ? instead of the accented character.

The servers are Solaris 10 with SunONE 6.1 Webservers

Update

We have now narrowed the problem down to the JVM. The file system looks OK, but we get the same problem with the files and directories if we include a Java class which uses the basic Java file IO.

Any suggestions on how to rectify this in JVM would be appreciated

3

There are 3 answers

3
ryber On

The problem may be that the chars in the dirs created by CF 4 are not unicode...in fact, if CF4 created them then I can pretty much guarantee that they are not because CF previous to 6 didn't know unicode or utf-8 from a hole in the ground. It often ended up using some wierd encodings. CF6+ on the other hand assumes that just about everything is utf-8.

2
Sergey Galashyn On

I believe this is your OS issue.

I am using CF8 dev edition on Ubuntu with Ukrainian locale, and can do the following things.

List directories with double-byte characters:

<cfset path = "/home/trovich/docs/журнали/" />
<cfdirectory action="list" directory="#path#" name="qGetDirectory" />
<cfinclude template="файл_з_іїґ.cfm">

File файл_з_іїґ.cfm contains following code:

<cfoutput>
<cfloop query="qGetDirectory">
#qGetDirectory.name#<br>
</cfloop>
</cfoutput>

And the result is following:

Акция
Ї
RING0
root#ua
PHP!nside
Phrack Magazine
phparchitect
Бійцівський Клуб
Bricolage
Друшляк

Nothing missed, include works perfectly.

P.S. Hope your brower will correctly render the Unicode chars.

0
Adam Tuttle On

I haven't found anything specific to your issue, but I did see this note in the Release notes for version 6:

You cannot use cfinclude to include a file with a double-byte file name.

No indication of whether or not that's been fixed. I'm not certain, but I assume that "double-byte" file names refers to using unicode, which I believe you need to use to get accented characters in file names... so it may be related in some way to your problem.

If you can't simply rename the files to remove the accented characters, I would recommend filing a bug in the official ColdFusion bug database.