2008
05.22

之前遇到一个问题,svn里面如果提交了中文文件名的文件或者包含其他特殊字符的文件名的文件,会导致linux或者freebsd上svn update/checkout的时候出现错误“svn: Can’t convert string from ‘UTF-8′ to native encoding”

这个问题是由系统字符集设置导致的,可以使用如下方法解决:
在bash的shell下,输入如下命令:

#export LC_CTYPE=en_US.UTF-8

然后运行如下命令确认发生的变化如下:

#locale

将得到如下的结果返回:

LANG=
LC_COLLATE="C"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

可以把以上内容直接加到svn的钩子里面,解决提交时自动输出处理遇到的问题。

2 comments so far

Add Your Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word