The Hunting of the Snark


category: encategory: tech created: 25. Apr. 2005
modified: 28. Apr. 2005
canonical: http://snark.de/index.cgi/0003

Subversion, Mac OSX and non-ASCII Filenames

Using the svn client to the subversion version control system on Mac OSX i ran into problems when someone had checked in files with german umlauts. i just got a message like

svn: Can't recode string
whenever i tried to check out or update a directory with one of these files. (I'm using a prebuilt version from Metissan here - I had the same results with the fink package ... lots of other ways to install it exist of course)

While svn internaly handles everything in unicode (using the UTF-8 encoding), the client did not know, how to translate the non ASCII characters into something the local filesystem understands. The HFS+ Filesystem on Mac OSX actually also uses UTF-8 - but we have to explicitely say so...

Since some other programs i use don't deal well with (variable length) multi byte charsets, i did not want to set my environment to UTF-8 permanently (that applies mostly to switching the Terminal.app to using UTF-8 too and getting interactive editing features out of sync - readline seems to print multi byte chars well; yet backspace deletes them one at a time visually but only only half of them internally...)

Solution:

In my bash .profile i defined the svn alias

alias svn='env LC_CTYPE=de_DE.UTF-8 /usr/bin/svn'
to set this environment just for the svn client.


(c) Heiko Hellweg 2005 - 2009 top