svn pre-commit 提交时输出中文的处理办法(ubuntu apache2)

在ubuntu环境下,svn的pre-commit中添加中文字符时:

LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c`
if [ "$LOGMSG" -lt 5 ];#要求注释不能少于 5 个字符,您可自定义
then
  echo -e "\n提交的信息说明内容不能为空!必须至少输入5个字符以上!\nLog message cann't be empty! you must input more than 5 chars as comment!." 1>&2
# echo "提交错误:提交的说明性信息内容必须至少有5个字符!" 1>&2
 exit 1
fi

# All checks passed, so allow the commit.
exit 0

提交代码发现错误提示:

[Error output could not be translated from the native locale to UTF-8.]“”

google后,进行如下更改:

1、更改/etc/apache2/envvars 中的内容:

源内容:

## The locale used by some modules like mod_dav
export LANG=C
## Uncomment the following line to use the system default locale instead:
#. /etc/default/locale

更改后内容:

## The locale used by some modules like mod_dav
#export LANG=C
## Uncomment the following line to use the system default locale instead:
. /etc/default/locale

2、重启apache: /etc/init.d/apache2 restart

再次在客户端提交commit,结果如下:

解决完成。

ref: 

https://stackoverflow.com/questions/2223958/pre-commit-hook-in-svn-could-not-be-translated-from-the-native-locale-to-utf-8

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值