Alex (SirShurf) Frenkel's Blog

A web log of a PHP professional

SVN (Subversion) and UTF files…

leave a comment »

Recently I had a strange problem.

One of my SVN hooks was failing and I had to login to the server to run the hook manually. At first I have thought that it’s a simple permission error but when I was running the same hook using the same user it was working.

After some googleing I have found that the SVN hook runs not in the user environment but without it, and in order to simulate it I need to run my hook in the same way.

The command to do it is: “env – ./post-commit”.

In this case I have seen the error and understood it. Since the SVN hook is not runs under the environment, the UTF-8 characters in file names are not visible in SVN Update.

If you have this problem all you need to do is to add next lines to your hook:


export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
export LC_CTYPE="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_TIME="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LC_PAPER="en_US.UTF-8"
export LC_NAME="en_US.UTF-8"
export LC_ADDRESS="en_US.UTF-8"
export LC_TELEPHONE="en_US.UTF-8"
export LC_MEASUREMENT="en_US.UTF-8"
export LC_IDENTIFICATION="en_US.UTF-8"
export LC_ALL=

That will set your environment for the SVN hook request to work with UTF characters!

Advertisements

Written by Alex (Shurf) Frenkel

May 19, 2011 at 5:26 pm

Posted in IDE, SVN

Tagged with , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: