2

I have the following folders on a CentOS 7 Droplet. They were added via FTP from a French operating system.

  • Evénement 1
  • Evénement 2
  • Evénement 3

The accented character (é) is replaced with a question mark when I do ls.

I cannot cd into these folders.

I have tried several suggestions from around the web without luck. Including:

cd Evénement\ 1
cd "Evénement 1"
cd "Ev?nement 1" (copying the exact output from ls)
cd Ev\nement\ 1
cd Ev\énement\ 1
cd Ev\351énement\ 1 (because ls -b outputs them like that)

Here is the output of locale.

LANG=en_CA.UTF-8
LC_CTYPE="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME="en_CA.UTF-8"
LC_COLLATE="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_PAPER="en_CA.UTF-8"
LC_NAME="en_CA.UTF-8"
LC_ADDRESS="en_CA.UTF-8"
LC_TELEPHONE="en_CA.UTF-8"
LC_MEASUREMENT="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"
LC_ALL=

Thanks in advance for any help.

  • try temporary set LANG=fr_CA.UTF-8 – mmv-ru Mar 18 '17 at 23:06
1

use single quotes and/or tab (autocomplete), like following:

mbp:~ alexus$ mkdir 'Evénement'
mbp:~ alexus$ cd 'Evénement'
mbp:Evénement alexus$ pwd
/Users/alexus/Evénement
mbp:Evénement alexus$ cd ..
mbp:~ alexus$ cd Evénement/
mbp:Evénement alexus$ 
  • Thanks. When I make a new directory via the command line it works well as it does for you. But these are all files that were added via FTP and that seems to have caused the issue since I can't get into them via command line. – Greg Mar 18 '17 at 22:42
  • @ScreenWatcher You really tried tab autocompletion? – mmv-ru Mar 18 '17 at 23:04
  • @screenwatcher yes, second try was with tab. – alexus Mar 18 '17 at 23:06
  • When I try tab autocompletion, it finds several folders with the same start to the filename, so doesn't autocomplete. I can hit tab twice to see the proposed names. Is there a way for me to autocomplete with one of those proposed names? – Greg Mar 21 '17 at 14:56
  • @ScreenWatcher Type Ev then hit tab) – alexus Mar 21 '17 at 14:59
0

Try cd "Ev*nement 1". cd "Ev?nement 1" (typing the ? yourself instead of copying it from the shell's output) may also work. My guess is that the question mark in the ls output is not a real question mark but rather a special character indicating the shell's failure to decode the character.

Can you post the output of locale?

  • Thanks, I tried those suggestions without success. I have added the output of locale to my original post. – Greg Mar 18 '17 at 22:42
0

I found a solution to this issue. I changed the character encoding from Unicode (UTF-8) to Western (ISO Latin 1) for my actual terminal program, iTerm2. I did this my modifying the profile that connects to this server as follows:

iTerm2 > Preferences > Profiles > Profile > Terminal > Character encoding

Now the accented characters show correctly and I can cd into them without trouble.

Thanks again to those who tried to help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.