Sounds like this may be an encoding issue. The problem I faced with file
names with German, Chinese, French characters is that the files names were
not encoded consistently. Macs will use UTF-8, I believe, Windows may use a
different encoding. So if you are searching for ä using ISO-8859 or
Windows-1252 encoding, your search and replace code may not find an ä
encoded with UTF-8. Remember that the computer is searching for a series of
1’s and 0’s, using a consistent encoding is essential. There is some
overlap between different encodings, hence ß may work, sometimes.
The point to keep in mind is that you cannot control the encoding of a file
being uploaded. To do what you want to do completely and correctly, your
find and replace code should take into account all possible encodings, in
all languages the files might be named in.
So like I said in another thread you started on this same topic, what I’ve
done is rename uploaded files to a name that I control, using CreateUUID()
plus the extension of the upload, and give the user a form field so that
they can fill in whatever name they want. In this case, I fully control the
encoding of the name they type into the form field, so I avoid the
potential for encoding issues. If you want to adapt that approach so that
you rename the file using the name the user types in, then I believe it
would be much easier to search and replace characters accurately, because
you would need to work in only one encoding, the one you specify.
What I do is store the name the user assigns to the file in the text field
I provide in the database, and display that name, not the UUID file name,
to the user. If they download it, the file itself can be renamed to the one
the user assigned to it on the way out - the user and/or their file system
can deal with any name conflicts that arise.
Aria Media Sagl
+41 (0)76 303 4477 cell
skype: ariamediaOn Tue, Dec 13, 2016 at 4:09 PM, ‘Michael Hnat’ via Lucee < lucee@googlegroups.com> wrote:
Well, this sounds like a client/browser issue. Maybe the default charset
in the browser is set different.
Could you check this?
But I know, that an ‚ä‘ on mac is a different character than the ‚ä‘ on
win. Could you just hash the filename (after checking the first point)? It
should be the same.
Best,
Michi
Von: lucee@googlegroups.com [mailto:lucee@googlegroups.com] *Im Auftrag
von *C.A.
Gesendet: Dienstag, 13. Dezember 2016 15:51
An: Lucee lucee@googlegroups.com
Betreff: [Lucee] Filenames with german umlaute making strange things on
upload rename
Hi,
I have a rail and a lucee server (4.5 and 5.1 version) doing strange
things with filenames with german umlaute like ä and ü, but not with “ß”.
When uploading in Windows, Android and Linux, everything works as we need
it. But with MacOS and OSX and Chrome or Firefox the umlaute can not be
replaced by script…
Is this a known issue?
Demolink can be provided. Code is nothing special. Just form with file and
cffile upload and rename with replace.
Regards
Christian
–
You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/lucee/2e818a3e-8a5d-4f87-8735-e51894bfa7e4%40googlegroups.com
https://groups.google.com/d/msgid/lucee/2e818a3e-8a5d-4f87-8735-e51894bfa7e4%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.
–
You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/lucee/011801d25552%24dcc430d0%24964c9270%24%40bluegras.de
https://groups.google.com/d/msgid/lucee/011801d25552%24dcc430d0%24964c9270%24%40bluegras.de?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.