svn:Can’t convert string from ‘UTF-8’ to native encoding

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

这个问题是由系统字符集设置导致的,可以使用如下方法解决:
在bash的shell下,输入如下命令:
[coolcode]
#export LC_CTYPE=en_US.UTF-8
[/coolcode]

然后运行如下命令确认发生的变化如下:
[coolcode]
#locale
[/coolcode]
将得到如下的结果返回:
[coolcode]
LANG=
LC_COLLATE=”C”
LC_CTYPE=”en_US.UTF-8″
LC_MESSAGES=”C”
LC_MONETARY=”C”
LC_NUMERIC=”C”
LC_TIME=”C”
LC_ALL=
[/coolcode]

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

Category: Linux / BSD, 其他技术  Tags:
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
3 Responses
  1. luguo says:

    记下了,今后用到svn的时候或许有用.

  2. ds cartes says:

    GOOD

Leave a Reply

Your email address will not be published. Required fields are marked *

*
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.
Anti-spam image