Help files with special characters Ñ and accents

Cristian29

New Member
Joined
May 9, 2023
Messages
1
Reaction score
0
Credits
15
My website offers several different .exe files for download by website users. The web server for the website runs 'linux 22.04 server with nginx'. Some of the filenames on the Linux server have special characters with diacritical marks or accents. When website users click the links to download those files from my website, the normal files download correctly, but clicking the links for filenames with special characters go to the 'Page Not Found' webpage. In an earlier version of the website that ran on a different Linux, this problem did not occur.
 
Last edited:


Try "strings" utility at terminal.

Code:
Usage: strings [option(s)] [file(s)]
 Display printable strings in [file(s)] (stdin by default)
 The options are:
  -a - --all                Scan the entire file, not just the data section [default]
  -d --data                 Only scan the data sections in the file
  -f --print-file-name      Print the name of the file before each string
  -n <number>               Locate & print any sequence of at least <number>
    --bytes=<number>         displayable characters.  (The default is 4).
  -t --radix={o,d,x}        Print the location of the string in base 8, 10 or 16
  -w --include-all-whitespace Include all whitespace as valid string characters
  -o                        An alias for --radix=o
  -T --target=<BFDNAME>     Specify the binary file format
  -e --encoding={s,S,b,l,B,L} Select character size and endianness:
                            s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit
  --unicode={default|show|invalid|hex|escape|highlight}
  -U {d|s|i|x|e|h}          Specify how to treat UTF-8 encoded unicode characters
  -s --output-separator=<string> String used to separate strings in output.
  @<file>                   Read options from <file>
  -h --help                 Display this information
  -v -V --version           Print the program's version number
strings: supported targets: elf64-x86-64 elf32-i386 elf32-iamcu elf32-x86-64 pei-i386 pe-x86-64 pei-x86-64 elf64-little elf64-big elf32-little elf32-big pe-bigobj-x86-64 pe-i386 pdb elf64-bpfle elf64-bpfbe srec symbolsrec verilog tekhex binary ihex plugin
Report bugs to <https://bugs.archlinux.org/>

Might have to use -U option in the least.
 
You don't say how you are downloading them, but a lot of the time Windows files need to have quotes.

For example if there are spaces in the file name.

wget https://somewebsite.com/my file name with spaces.exe

usually won't work.

But...

wget "https://somewebsite.com/my file name with spaces.exe"

will.

The same with curl, scp, cp rm and many other commands.

rm my windows file

doesn't work
but...

rm "my windows file"

does.

Also, if there are special characters, like , or ' then quotes help here also.

rm "I_don't_want_this_file_anymore"

You can also use escape characters.
 
Sometimes when there are files that I have trouble figuring out how to make character symbol for.. you can cheat.
The tab auto-fill function is great for this. But this only works if the filename is mostly unique.

For example I don't know how to make a

Ñ​

But my filename is abcdefÑxx.txt

I can just type cp abcde
and press the 'tab' key. It will fill in the rest of the file name for me.

@KGIII these last two posts might make a good LinuxTips article.
 
Could the responses above be answering the wrong question? Here is the question the way I interpreted it.

(NOTE: Rewritten by Sphen. @Cristian29: Is this reworded version of the question correct?):

"My website offers several different .exe files for download by website users. The web server for the website runs 'linux 22.04 server with nginx'. Some of the filenames on the Linux server have special characters with diacritical marks or accents. When website users click the links to download those files from my website, the normal files download correctly, but clicking the links for filenames with special characters go to the 'Page Not Found' webpage. In an earlier version of the website that ran on a different Linux, this problem did not occur."

-> The OP seems to need help with a web server configuration issue, not downloading files with a special character in the filename. I would like to help more, but this question is "outside my wheelhouse." I assume that 'linux 22.04 server with nginx' means 'Ubuntu Linux 22.04 LTS'.

Edit much later:
Pasted the re-worded question not in a "quote" so that all of it would remain visible.
 
Last edited:
@KGIII these last two posts might make a good LinuxTips article.

I've bookmarked 'em (via the forum's software). We shall see and thanks!
 
In another Linux machine with a previous version, that did not happen, it would let them download, it should be noted that I already verified everything utf-8 and it is in order.
Compare the two Nginx configurations, it easy to overlook something if you configure it manually and only do it once every few years.
 
I wouldn't recommend bare executable files in any format available for download. But otherwise the party offering such files should be considerate with other people and change the names of the files so the only characters used are ASCII codes 33 to 126 inclusive. Even if it looks unclear written in Spanish, Turkish, Vietnamese or other fussy language. Not everybody is going to use the same "C locale" and is willing to change it to the same as the source of the downloads.
 
The OP seems to need help with a web server configuration issue, not downloading files with a special character in the filename.

It seems to me the website works fine, files with no special characters download fine.
the files are downloaded automatically when clicking the link but in files with accents or ñ sends to page not found.

It seems to be only the files with special characters that cannot be downloaded.

but some have accents and ñ, the website does not recognize them and sends to page not
found, do you know if I can do something to make it recognize those characters and My clients can download those files, the files are downloaded automatically when clicking the link but in files with accents or ñ sends to page not found.
 

Members online


Top