标签:svn
今天在down代码时遇到了如下问题:
[xxx@xxx ~]$ svn co https://xxxxxxxxxxxxx
svn: Can‘t convert string from ‘UTF-8‘ to native encoding:
svn: xxxxxxxx/include/xml_inc/XML/?\194?\184?\194?\180?\194?\188?\195?\190 mcXML.h
这个问题主要是代码中包含了中文名字的文件,svn这边的编码不支持造成的。
在网上查了一些资料,基本上都是用下面的方法,但是都不管用(分割线以内的是不好使的方法)
==========================================分割线==========================================
因为SVN客户端需要utf8来支持中文。
解决办法很简单,正确设置当前系统的 locale:
export LC_CTYPE=zh_CN.UTF-8
或者
export LC_CTYPE=en_US.UTF-8 (我设的是en_US.UTF-8)
然后重新 checkout 即可。
如果 export LC_CTYPE=zh_CN.UTF-8 提示
warning:> locale
locale: Cannot set LC_CTYPE to default locale: No such file ordirectory
locale: Cannot set LC_MESSAGES to default locale: No such file ordirectory
locale: Cannot set LC_ALL to default locale: No such file ordirectory 等信息
可以尝试
locale-gen en_US.UTF-8
==========================================分割线==========================================
用了上面的这些方法之后:[xxx@xxx ~]$ svn update
svn: Error converting entry in directory ‘xxxxxxxx/include/xml_inc/XML‘ to UTF-8
svn: Valid UTF-8 data
(hex:)
followed by invalid UTF-8 sequence
(hex: b8 b4 bc fe)
还是不行
问了一下其他同事的解决办法:
将.bashrc中加上这么一行:
export LANG=zh_CN.GB18030
[xxx@xxx ~]$ locale
LANG=zh_CN.GB18032
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
这样就好使了,下载途中还有一点小问题,会出现
svn: 方法 REPORT 失败于 “/xxxxxx/!svn/vcc/default”: 200 OK (https://xxxxxxxxxxxxxxx)
我们不管它,直接再执行下面语句即可解决svn的问题
[xxx@xxx ~]$ svn update
svn: Can't convert string from 'UTF-8' to native encoding 解决办法,布布扣,bubuko.com
svn: Can't convert string from 'UTF-8' to native encoding 解决办法
标签:svn
原文地址:http://blog.csdn.net/jievisionvanish/article/details/38401807