Re: About japanese character error
Michael Haggerty <[email protected]>
| Newsgroups | gmane.comp.version-control.subversion.cvs2svn.user |
|---|---|
| Message-ID | <[email protected]> |
On 11/26/2010 08:03 AM, David Wang wrote:
> Has anyone succeed import files with Japanese file name or comment? I
> got stuck here for almost two weeks.
>
> I update cvs2svn to the latest version 2.3.0, and python to v2.7, but
> when I tried to excute following operation, the error has reported in
> step 16
>
> Python2.7 cvs2svn --encoding=shift_jis --encoding=gb2312
> --fallback-encoding=sjis --existing-svnrepos -s
> /home/svnroot/test_wangwei /home/cvsroot/smplus/cvs2svn_test
>
> The error is:
>
> ERROR: Unable to convert a path 'trunk/¥¿¥¤¥ß¥ó¥°¥Á¥ã©`¥È1.txt' to
> internal encoding.
> Consider rerunning with one or more '--encoding' parameters or
> with '--fallback-encoding'.
>
> There are several file with Japanese or Chinese filename. The Chinese
> filename can be pass but Japanese failed.
Is the indicated filename correctly encoded in some encoding system? It
seems a little bit funny that the base filename seems to be a two-byte
encoding but the extension (".txt") is apparently a one-byte encoding
compatible with ASCII. Perhaps the two parts are inconsistent with each
other and that is giving the decoders problems.
The --fallback-encoding option on the command line only applies to
author names and log messages; it does not apply to filenames because it
was thought that decoding filenames incorrectly would be unacceptable to
most people. If you want the "fallback" behavior to apply to filenames,
you have to start cvs2svn using the options file method. In the example
options files you can set a fallback encoding for
"ctx.cvs_filename_decoder".
If you would like to fix the problem instead of working around it, then
you can either rename the RCS file inside the CVS repository. Or you
can program your own "decoder" function in Python; it should be a
callable that takes an 8-bit string as input and returns a Unicode string.
Michael
--
Michael Haggerty
[email protected]
http://softwareswirl.blogspot.com/
------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1670&dsMessageId=2685877
To unsubscribe from this discussion, e-mail: [[email protected]].