[Qgis-developer] UTF-8 Filenames, SVN, Qt and Macs

Tom Elwertowski telwertowski at comcast.net
Sun Dec 9 21:06:13 EST 2007


Hi all (especially Mac builders),

Since a UTF-8 filename was recently added to svn and the filename is 
also read as text from the AUTHORS file, here are some Mac notes 
regarding the use of UTF-8 filenames and text.

1. Mac users need to define LC_CTYPE to use svn with UTF-8 filenames.
2. Developers should call setCodec("UTF-8") when reading UTF-8 content 
using QTextStream.

If LC_CTYPE has not been defined, you will encounter the error:

svn: Can't convert string from 'UTF-8' to native encoding:

To get past this, define the following (locale can vary):

export LC_CTYPE=en_US.UTF-8

There are still some problems but I think they are due to the bash shell 
distributed with OS X 10.4. Installing a newer one is rumored to help 
but you can also just ignore the following:

'ls' will display ?? for each UTF-8 character.

'svn status' will respond with both a '!" (file is missing) and '?' 
(extra file is present) for any file with a UTF-8 filename. This results 
in a 'M' (modified) in the version number even when nothing is modified.

Since the AUTHORS file also contains UTF-8, setCodec("UTF-8") must be 
called for a QTextStream reading the file. Linux reads UTF-8 by default 
but the Mac does not.

Tom




More information about the Qgis-developer mailing list