Reputation: 15581
On one of our ColdFusion 10 enterprise / CentOS 6.5 servers umlauts in filenames are saved as ?
.
For example:
<CFPROCESSINGDIRECTIVE pageencoding="UTF-8">
<CFSET VARIABLES.umlauts = "ümläüté" />
<CFSET VARIABLES.filename = createUUID() & "-" & VARIABLES.umlauts & ".txt" />
<CFFILE action="write" output="#VARIABLES.umlauts#" file="#expandpath("./" & VARIABLES.filename)#" />
<CFOUTPUT>#VARIABLES.filename#</CFOUTPUT> <!--- outputs something like: A9C9BC8C-983A-5EA6-A4ED411BA0E63C72-ümläüté.txt --->
writes a file called A8B49720-020A-2500-605F4CC73129D07C-?ml??t?.txt
to disk. The content of the file is like expected "ümläüté".
Manual creating files with umlauts in filename is no problem (e.g. touch äöüß.txt
works like expected).
More details of server:
Java Version: 1.6.0_29
Tomcat Version: 7.0.23.0
Java File Encoding: UTF8
$ cat /etc/sysconfig/i18n
LANG="en_US.UTF-8"
$ locale
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
Any ideas what could cause this behaviour?
Upvotes: 2
Views: 1154
Reputation: 5510
I'll put it out as an answer for more clear visibility.
A user of Open Blue Dragon (an alternative CFML Engine) was having exactly the same issue.
If I try to upload a file with, for example, the filename "testätest.pdf", then I have the following situation:
- The file, OpenBD stores to my filesystem, is named: test?test.pdf
- The filename, reported via #cffile.ServerFile# is: testätest.pdf
He later came back with this answer
It seems like this has been resolved by setting "LC_ALL=en_US.UTF-8". It seems to be a tomcat problem that it sets question marks for special characters if the charset is unknown.
Or, in the OP's case, to set LC_All
to "de_DE.UTF-8"
perhaps.
Upvotes: 1