CF目录与Coldfusion 11,在文件名中的非ASCII字符 [英] CFdirectory with Coldfusion 11, issue with non ascii characters in filenames

查看:148
本文介绍了CF目录与Coldfusion 11,在文件名中的非ASCII字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个类似的问题:



我有同样的问题,我只是添加到文件〜/。 bashrc 这些行:

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

不会重新启动ColdFusion服务器

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


I have a similar question to this: ColdFusion, CFDirectory and the French which was not given a satisfactory answer.

We have upgraded from Coldfusion 9 to Coldfusion 11. So far no major problems except the following:

When using CFdirectory to display file names that contain non ASCII characters in their names (eg: accents, umlauts) we get to see the file name with replacement characters � instead of the correct UTF equivalent. For example a file named L’État, c’est moi.pdf is displayed as L�����tat, c���est moi.pdf.

We are confident that this is a Coldfusion issue as nothing has changed but the Coldfusion version. With Coldfusion 9 CFdirectory worked OK when listing the same accented filenames. Our OS is Redhat 7.0 and the file names are also displayed correctly on the terminal with the ls command. I have also created a quick PHP script to see if PHP can read correctly the directory with the "readdir" command and there no problems there either, filenames are rendered correctly.

So I believe this has to be a Coldfusion 11 issue. I have added the -Dfile.encoding=UTF-8 -Dencoding=UTF-8 parameters in the JVM settings from the Coldfusion administrator server interface but it made no difference.

Any suggestions on how to rectify this would be appreciated.

example of code used follows:

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

解决方案

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

Please have a look here.

I had the same problem, I just add into the file ~/.bashrc these lines:

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 your Coldfusion Server

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

这篇关于CF目录与Coldfusion 11,在文件名中的非ASCII字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆