bartgol
bartgol

Reputation: 1873

Bash: cannot create directory with unicode character

I am trying to checkout a git repo (this) which requires the creation of a folder with unicode characters (the name is uni¢𐍈d€), where the missing character (I don't know how to render it here) is the Hwair gothic character. On my workstation, it works fine, but when I try to do it on a server (RedHatEnterpriseServer, where I do NOT have sudo powers), I get the error

fatal: cannot create directory at 'python/ycm/tests/testdata/uni¢𐍈d€': Permission denied

As a side note, I have tried to create the folder manually, and the hwair character is the only one that gives problems, meaning, that the folder uni¢d€ can be successfully created.

The LANG variable is set to en_US.UTF-8 on both systems. I have tried to find the differences between my workstation fonts and the server fonts. Grepping 'hwair', I found a font on my workstation that was missing on the server, so I copied the font folder in ~/.fonts on the server, and ran fc-cache, but that didn't work.

Google-ing hwair and grepping here and there on my workstation and the server, I found out that the 'hwair' character should be in the Code2001 font, which I think should be installed on both systems, since both system have the file /etc/fonts/conf.d/69-unifont.conf, which are identical, and contain the line

<family>Code2001</family> <!-- plane1 and beyond -->

I never really dealt with fonts at this fine level, so I'm not really sure if this is something solvable by adding some fonts locally or not (perhaps the system inhibits such particular fonts). I don't even know if copying fonts files to ~/.fonts/ and running fc-cache is enough or if there is something more to it.

So I guess the questions are:

  1. Is the problem related to missing fonts on the server?
  2. If yes, how can I add the missing font?
  3. If no, is it related to something I cannot fix (perhaps it requires sudo privileges)?

Edit: the folder that cannot be created is part of the git repository. The error appears when cloning the repo (or anytime you try to checkout the master branch). I don't think there is an issue with permissions, otherwise it would fail also on my workstation (the permissions of the 'host' folder are the same). Also, trying to do mkdir $( printf 'uni¢\xF0\x90\x8D\x88d€' ) does not work either. The bash seems indeed to interpret correctly the unicode encoding, since when printing 'cannot create...', the name of the folder DOES show the hwair symbol.

Edit2: if you think the question has some flaws, please, add a comment rather than just voting for closing. I'm happy to change/edit/improve if need be.

Upvotes: 3

Views: 642

Answers (1)

J&#246;rg P.
J&#246;rg P.

Reputation: 41

I had the exact same issue!

It seems that for some - unknown to me - reason it is not possible to have that Hwair character in filenames on some filesystems as that other guy has already mentioned.

So as a workaround I suggest that you look at the available filesystems with something like:

df -Th

and then e.g. use a symbolic link to a filesystem which uses ext4.

FYI: The filesystem where it didn't work for me is of type nfs4.

Upvotes: 3

Related Questions