[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: post-commit hook script to update a live website

From: Bob Proulx <bob_at_proulx.com>
Date: 2006-12-05 05:03:57 CET

Dongsheng Song wrote:
> $ locale
> ...
> Then at the script beginning, set LC_ALL with the correct value at
> the script begin
>
> Eclipse settings, the native encoding, not the file name encoding.
> And because the hook no LC env value, it may be system default, not as
> you expected.

Good suggestions.

> 2006/12/4, Thanos <thanos.a@fastwebnet.it>:
> >svn: Can't convert string from native encoding to 'UTF-8':
> >svn: forl?\195?\172.htm
> >
> >According to my Eclipse settings, native encoding is set to ISO-8859-1
> >What should I do to fix this issue ? And why does it happen only when
> >the hook is executed by svn ?

Being very traditional with my filenames I have not run into that
problem before and so can only suggest a few things.

As suggested check the locale setting in the hook script.

  locale

Set the locale in that hook script.

  LANG=en_US.UTF-8
Or
  LANG=en_US

Or something like that. On my system en_US maps to ISO-8859-1 and
en_US.UTF-8 maps to UTF-8.

Note that the order of preference of environment variables is the
following:

  LANG
  LC_CTYPE
  LC_ALL

Often you read people say to set LC_ALL. I do that when I don't want
to worry that a higher priority setting might override since LC_ALL is
the highest priority. But generally you really want to set the lowest
possible one. And LC_COLLATE and LC_CTYPE must be compatible types.
So if only LANG is set to the wrong value, or not set at all then the
variable to set is LANG=en_US or some such.

Having a character encoding issue like this with the hook scripts
seems like a generic problem. I am surprised that this is not handled
already. So I am left wondering. Perhaps something is actually
breaking it as opposed to not being handled right. Don't know.

BTW... Generally UTF-8 is the way of the future. I will go out on a
limb and say that the locale en_US is mostly obsolete.

Bob

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Dec 5 05:03:32 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.