cvs2svn转换Repository时,中文更新记录乱码的问题
授权方式:署名,非商业用途,保持一致,转载时请务必以超链接(http://www.fwolf.com/blog/post/64)的形式标明文章原始出处和作者信息及本声明。使用使用cvs2svn转换Repository的时候,发现转换过来的更新记录中,所有的中文都是乱码,不是显示方块,就是问号,原来是没有加上–encoding参数的缘故,原来使用的命令如下:
c:/python23/python h:/cvs2svn-1.2.1/cvs2svn -s h:/svn/repo h:/cvsroot/repo
–encoding参数的含义是“所采用的编码,默认为ascii”,但我加上这个参数“–encoding=gb2312”之后,转换却出了问题,提示
LookupError: unknown encoding: gb2312
原来cvs2svn在转换的时候使用 的是Python的字符集,而Python
2.3好像不支持gb2312字符集,因此更新到Python
2.4.1并使用如下命令进行转换
c:/python24/python h:/cvs2svn-1.2.1/cvs2svn –encoding=gb2312 -s h:/svn/repo h:/cvsroot/repo
就一切正常了,转换很顺利,更新记录中的中文也没有乱码。
这里有Python 2.4支持的所有字符集列表。
No tags for this post.
![[Bloglines]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/bloglines.png)
![[co.mments]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/comments.png)
![[del.icio.us]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/digg.png)
![[diigo]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/diigo.png)
![[Facebook]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/facebook.png)
![[Furl]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/furl.png)
![[Google]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/google.png)
![[MySpace]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/myspace.png)
![[Reddit]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/reddit.png)
![[Rojo]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/rojo.png)
![[Slashdot]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/slashdot.png)
![[StumbleUpon]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Technorati]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/technorati.png)
![[Windows Live]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/windowslive.png)
![[Yahoo!]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/email.png)