threads / discuss / 21803

Umlaut in filename makes troubles

Subject: Umlaut in filename makes troubles

## tl;dr

8 messages between Dec 1, 2009 and Dec 1, 2009.

replies: 7people: 4as markdown or json

rick23@gmx.net· Dec 1, 2009, 07:15 UTC · lore

I have problems with my repository under slackware vs. windows. I created a repo in linux and every time I use it under msysgit, the files containing umlauts in the filename are marked as deleted (and vice versa).

For instance: the repo perfectly synced under msysgit leads to:

user@sauron:/media/disk-2$ git status |grep Auszug # deleted: "trunk/007_Literatur/Auszug aus Ergonomische Untersuchung des Lenkgef\374hles.docx" # "trunk/007_Literatur/Auszug aus Ergonomische Untersuchung des Lenkgef\303\274hles.docx"

in linux. But the file exists and is displayed correctly in the shell or in dolphin (my filemanager under X):

user@sauron:/media/disk-2$ ls trunk/007_Literatur/Auszug* trunk/007_Literatur/Auszug aus Ergonomische Untersuchung des Lenkgefühles.docx

Can you please give me a hint what to do?
TIA
Øyvind A. Holm· Dec 1, 2009, 07:44 UTC · re: rick23@gmx.net · lore

Re: Umlaut in filename makes troubles

On 2009-12-01 08:15:08, rick23@gmx.net wrote:
Show 21 quoted lines
> I have problems with my repository under slackware vs. windows. I 
> created a repo in linux and every time I use it under msysgit, the 
> files containing umlauts in the filename are marked as deleted (and 
> vice versa).
>
> For instance: the repo perfectly synced under msysgit leads to:
>
> user@sauron:/media/disk-2$ git status |grep Auszug
> #       deleted:    "trunk/007_Literatur/Auszug aus Ergonomische 
> Untersuchung des Lenkgef\374hles.docx"
> #       "trunk/007_Literatur/Auszug aus Ergonomische Untersuchung des 
> Lenkgef\303\274hles.docx"
>
> in linux. But the file exists and is displayed correctly in the shell 
> or in dolphin (my filemanager under X):
>
> user@sauron:/media/disk-2$ ls trunk/007_Literatur/Auszug*
> trunk/007_Literatur/Auszug aus Ergonomische Untersuchung des 
> Lenkgefühles.docx
>
> Can you please give me a hint what to do?

Try to specify "utf8" as mount option under Linux. You can also try experimenting with the "nls" mount option, check out the mount(8) man page to see how it's used.

Additionally, I found that I need "shortname=mixed" when mounting USB memory cards. As filenames are case insensitive in Windowsworld and gadgets using vfat, Linux tend to treat them differently.

Regards, Øyvind

+-| Øyvind A. Holm <sunny@sunbase.org> - N 60.39548° E 5.31735° |-+
| OpenPGP: 0xFB0CBEE894A506E5 - http://www.sunbase.org/pubkey.asc |
| Fingerprint: A006 05D6 E676 B319 55E2  E77E FB0C BEE8 94A5 06E5 |
+------------| 760e5d4a-de4c-11de-a982-90e6ba3022ac |-------------+
Jochen· Dec 1, 2009, 08:26 UTC · re: Øyvind A. Holm · lore

Re: Umlaut in filename makes troubles

Øyvind A. Holm wrote:
Show 24 quoted lines
> On 2009-12-01 08:15:08, rick23@gmx.net wrote:
> > I have problems with my repository under slackware vs. windows. I
> > created a repo in linux and every time I use it under msysgit,
> > the files containing umlauts in the filename are marked as
> > deleted (and vice versa).
> >
> > For instance: the repo perfectly synced under msysgit leads to:
> >
> > user@sauron:/media/disk-2$ git status |grep Auszug
> > #       deleted:    "trunk/007_Literatur/Auszug aus Ergonomische
> > Untersuchung des Lenkgef\374hles.docx"
> > #       "trunk/007_Literatur/Auszug aus Ergonomische Untersuchung
> > des Lenkgef\303\274hles.docx"
> >
> > in linux. But the file exists and is displayed correctly in the
> > shell or in dolphin (my filemanager under X):
> >
> > user@sauron:/media/disk-2$ ls trunk/007_Literatur/Auszug*
> > trunk/007_Literatur/Auszug aus Ergonomische Untersuchung des
> > Lenkgefühles.docx
> >
> > Can you please give me a hint what to do?
>
> Try to specify "utf8" as mount option under Linux. 

The automount of KDE 4.2.4 already used utf-8 (I guess the filenames would be garbled in dolphin otherwise)

> You can also try
> experimenting with the "nls" mount option, check out the mount(8)
> man page to see how it's used.

Ufff, I'm sorry - I'm not sure how to pass this to the automouter. I'd tried to mount the stick manually (with and without utf) and without utf8 the filenames are display strange from "ls".

> Additionally, I found that I need "shortname=mixed" when mounting
> USB memory cards. As filenames are case insensitive in Windowsworld
> and gadgets using vfat, Linux tend to treat them differently.
My automouter done it as

/dev/sde on /media/disk-2 type vfat (rw,nosuid,nodev,uhelper=hal,uid=1000,utf8,shortname=mixed)

So the options look right to me.

Kindest regards Jochen

Michael J Gruber· Dec 1, 2009, 07:54 UTC · re: rick23@gmx.net · lore

Re: Umlaut in filename makes troubles

rick23@gmx.net venit, vidit, dixit 01.12.2009 08:15:
Show 21 quoted lines
> I have problems with my repository under slackware vs. windows. I 
> created a repo in linux and every time I use it under msysgit, the 
> files containing umlauts in the filename are marked as deleted (and 
> vice versa).
> 
> For instance: the repo perfectly synced under msysgit leads to:
> 
> user@sauron:/media/disk-2$ git status |grep Auszug
> #       deleted:    "trunk/007_Literatur/Auszug aus Ergonomische 
> Untersuchung des Lenkgef\374hles.docx"
> #       "trunk/007_Literatur/Auszug aus Ergonomische Untersuchung des 
> Lenkgef\303\274hles.docx"
> 
> in linux. But the file exists and is displayed correctly in the shell 
> or in dolphin (my filemanager under X):
> 
> user@sauron:/media/disk-2$ ls trunk/007_Literatur/Auszug*
> trunk/007_Literatur/Auszug aus Ergonomische Untersuchung des 
> Lenkgefühles.docx
> 
> Can you please give me a hint what to do?

I would say you can give us more info about your setup. If I understand you correctly, you use the same repo and checkout under linux and msysgit. What kind of filesystem is this on, what are the mount options? What is your locale ($LANG) in slackware?

Michael
Jochen· Dec 1, 2009, 09:06 UTC · re: Michael J Gruber · lore

Re: Umlaut in filename makes troubles

Michael J Gruber wrote:
Show 25 quoted lines
> > I have problems with my repository under slackware vs. windows. I
> > created a repo in linux and every time I use it under msysgit,
> > the files containing umlauts in the filename are marked as
> > deleted (and vice versa).
> >
> > For instance: the repo perfectly synced under msysgit leads to:
> >
> > user@sauron:/media/disk-2$ git status |grep Auszug
> > #       deleted:    "trunk/007_Literatur/Auszug aus Ergonomische
> > Untersuchung des Lenkgef\374hles.docx"
> > #       "trunk/007_Literatur/Auszug aus Ergonomische Untersuchung
> > des Lenkgef\303\274hles.docx"
> >
> > in linux. But the file exists and is displayed correctly in the
> > shell or in dolphin (my filemanager under X):
> >
> > user@sauron:/media/disk-2$ ls trunk/007_Literatur/Auszug*
> > trunk/007_Literatur/Auszug aus Ergonomische Untersuchung des
> > Lenkgefühles.docx
> >
> > Can you please give me a hint what to do?
>
> I would say you can give us more info about your setup. If I
> understand you correctly, you use the same repo and checkout under
> linux and msysgit. 

Right - I created it under linux on a local directory, cloned it to an usb-stick and cloned it again under windows. I then worked under windows (msysgit) and pushed it to the stick again. Now I am back an my linux maschine and the files with umlauts in the filenames are mared as deleted.

> > What kind of filesystem is this on, what are the
> mount options? 

/dev/sde on /media/disk-2 type vfat (rw,nosuid,nodev,uhelper=hal,uid=1000,utf8,shortname=mixed)

mounted by the automounter of KDE 4.2.4
> What is your locale ($LANG) in slackware?
LANG=de_AT.utf-8
Jochen
Jochen· Dec 1, 2009, 09:58 UTC · re: rick23@gmx.net · lore

Re: Umlaut in filename makes troubles

I found another strange effect...

I made a file with "touch aöäü.txt" and from "git status" I get # "a\303\266\303\244\303\274.txt" reported as untracked. But when I start "git gui" I get file displayed with it's correct name...

Michael J Gruber· Dec 1, 2009, 14:10 UTC · re: Jochen · lore

Re: Umlaut in filename makes troubles

Jochen venit, vidit, dixit 01.12.2009 10:58:
Show 7 quoted lines
> I found another strange effect...
> 
> I made a file with "touch aöäü.txt" and from "git status" I get 
> #       "a\303\266\303\244\303\274.txt"
> reported as untracked. But when I start "git gui" I get file displayed with 
> it's correct name...
> 
Does this change after
git config core.quotepath false
Michael
Daniel Barkalow· Dec 1, 2009, 18:48 UTC · re: rick23@gmx.net · lore

Re: Umlaut in filename makes troubles

On Tue, 1 Dec 2009, rick23@gmx.net wrote:
Show 12 quoted lines
> I have problems with my repository under slackware vs. windows. I 
> created a repo in linux and every time I use it under msysgit, the 
> files containing umlauts in the filename are marked as deleted (and 
> vice versa).
> 
> For instance: the repo perfectly synced under msysgit leads to:
> 
> user@sauron:/media/disk-2$ git status |grep Auszug
> #       deleted:    "trunk/007_Literatur/Auszug aus Ergonomische 
> Untersuchung des Lenkgef\374hles.docx"
> #       "trunk/007_Literatur/Auszug aus Ergonomische Untersuchung des 
> Lenkgef\303\274hles.docx"

So the directory contains the utf-8 name, but the index contains a latin-1 name, when you wrote it under Windows and are looking at it under Linux. You probably want to use utf-8 for your repository, so that it's not specific to your locale.

Show 6 quoted lines
> in linux. But the file exists and is displayed correctly in the shell 
> or in dolphin (my filemanager under X):
> 
> user@sauron:/media/disk-2$ ls trunk/007_Literatur/Auszug*
> trunk/007_Literatur/Auszug aus Ergonomische Untersuchung des 
> Lenkgefühles.docx

You've got a utf-8 filesystem, so the u-with-umlaut is the two-byte sequence git is showing in the message as being present, not the single byte that it's showing as deleted. It looks like you're actually using utf-8 for what's on the usb stick, so you probably want the names listed in the repository to match that, which means that the correct one here is Linux.

> Can you please give me a hint what to do?

Convince Windows (or msysgit) to report filenames to git in utf-8. (I don't know *how*, but that's *what* you probably want to do.)

Once you've got everything agreeing on the character set used for filenames, you can disable "core.quotepath" to make the messages appear with umlauts; if you turned that off before fixing the inconsistancy, it would be much trickier to debug, because the "deleted" line would contain something that your Linux display won't consider a valid character.

	-Daniel
*This .sig left intentionally blank*

← back to recent threads