CFdirectory with Coldfusion 11, issue with non ascii names in filenames

I have a similar question: ColdFusion, CFDirectory and French which has not received a satisfactory answer.

We've moved from Coldfusion 9 to Coldfusion 11. There are still no major issues other than the following:

When using CFdirectory to display filenames that contain non-ASCII characters in the names (e.g. accents, umlauts), we get to see the filename with the substituted characters instead of the correct UTF equivalent. For example, a file named LÉtat, cest moi.pdf appears as Ltat, c est moi.pdf.

We're pretty sure this is a Coldfusion issue, as nothing has changed except for the Coldfusion version. With Coldfusion 9, CFdirectory worked fine when listing the same accented filenames. Our OS is Redhat 7.0 and the filenames are also displayed correctly on the terminal using the ls command. I also created a quick PHP script to see if PHP can read the directory correctly using the "readdir" command and there is no problem, the filenames are displayed correctly.

So I believe it must be a Coldfusion 11 issue. I added the -Dfile.encoding = UTF-8 -Dencoding = UTF-8 options in the JVM settings from the Coldfusion admin server interface, but it didn't matter.

Any suggestions on how to fix this would be appreciated.

Example of used code:

<cfdirectory
action="list"
directory="#ExpandPath( './' )#/pdfs"
listinfo="name"
name="qFile"
/>  
<cfdump
var="#qFile#"
label="All Files"
/>

      

This the output of the cfdump:

+3


source to share


3 answers


Have you tried setting the cfprocessingdirective tag ?

<cfprocessingdirective pageencoding="utf-8">

      

CF 11 WikiDocs



Also, in the Chrome Network Inspector, make sure the encoding returns correctly. For example:

Content-Type:text/html; charset=UTF-8

      

0


source


If your environment is Linux, you need to have a clean UTF-8 configuration.

Please take a look here .

I had the same problem, I just add the ~/.bashrc

following lines to the file :



export LC_ALL=en_US.UTF-8 
export LANG=en_US.UTF-8 
export LANGUAGE=en_US.UTF-8

      

After that, don't forget to restart the Coldfusion server

sudo /opt/coldfusion11/cfusion/bin/coldfusion restart

      

0


source


Note: Why are certain characters not typed correctly by SQL Server from the CFQUERY file?

Make sure your file is saved with Unicode UTF-8 encoding.

Also make sure your JVM arguments will handle this as well. Admin> Server Settings> Java & JVM. Add "-Dfile.encoding = UTF-8" to Arguments.

enter image description here

0


source







All Articles