在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: