小编Ale*_*aes的帖子

svn中的pre-commit hook:无法从本地语言环境转换为UTF-8

我的预提交钩子有问题.

如果文件在用户提交时被锁定,则此挂钩测试.当出现错误情况时,应输出另一个用户正在锁定此文件,或者如果没有人锁定,则应显示"您没有锁定此文件消息(文件名)".当文件的名称有一些像"ç"这样的拉丁字符并且乌龟在输出中显示这个时,会发生错误.

提交失败(详细信息如下):提交被预提交挂钩(退出代码1)阻止,输出:[错误输出无法从本地语言环境转换为UTF-8.]

你知道我怎么解决这个问题?

谢谢,

亚历山大

我的shell脚本在这里:

#!/bin/sh
REPOS="$1"
TXN="$2"
export LANG="en_US.UTF-8"
/app/svn/hooks/ensure-has-need-lock.pl "$REPOS" "$TXN"
if [ $? -ne 0 ]; then exit 1; fi
exit 0

我的perl在这里:

!/usr/bin/env perl  

#Turn on warnings the best way depending on the Perl version.   
BEGIN {   
  if ( $] >= 5.006_000)   
    { require warnings; import warnings; }                         
  else     
    { $^W = 1; }                  
}              

use strict;   
use Carp;   

&usage unless @ARGV == 2;   

my $repos        = shift;   
my $txn          = shift;    

my $svnlook …
Run Code Online (Sandbox Code Playgroud)

svn hook utf-8

7
推荐指数
1
解决办法
9808
查看次数

有没有办法在Perl中加载配置文件?

有没有办法在Perl中加载配置文件?

就像在shell文件中一样:

.〜用户/ .profile中

unix profile perl

-1
推荐指数
1
解决办法
4251
查看次数

标签 统计

hook ×1

perl ×1

profile ×1

svn ×1

unix ×1

utf-8 ×1