Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to solve the problem of Can't convert string from when Linux uses svn Times

Shulou Source: shulou.com Published: 2022-06-01 15:50:04 10月03日 Update

This article mainly explains how to solve the problem of Can't convert string from when Linux uses SVN. Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to solve the problem of Can't convert string from when Linux uses SVN.

When Linux uses svn, there is an error prompt, that is, can't convert string from 'UTF-8' to native encoding, which is mainly caused by the coding format. The following editor will introduce the solution to this problem.

In linux, svn co, svn up or svnc cleanup, if a file with a Chinese file name reports the following error:

Svn: Can't convert string from 'UTF-8' to native encoding:

Svn: src/main/webapp/resources/js/My97DatePicker/? two hundred and twenty nine? one hundred and eighty eight? one hundred and twenty eight? two hundred and twenty nine? one hundred and forty three? one hundred and forty five? two hundred and twenty nine? one hundred and forty? one hundred and thirty three

The first line roughly means that strings cannot be converted from UTF-8 encoding to local, mainly because SVN clients need utf8 to support Chinese.

The file path of the second line reimbursement, look at the file under its path, there must be a file named in Chinese. Therefore, you need to check the system code file:

LANG=en_US.UTF-8

LC_CTYPE= "C"

LC_NUMERIC= "C"

LC_TIME= "C"

LC_COLLATE= "C"

LC_MONETARY= "C"

LC_MESSAGES= "C"

LC_PAPER= "C"

LC_NAME= "C"

LC_ADDRESS= "C"

LC_TELEPHONE= "C"

LC_MEASUREMENT= "C"

LC_IDENTIFICATION= "C"

LC_ALL=C

Just modify the bash_profile file and add the following lines:

Export LC_ALL=en_US.UTF-8

Export LANG=en_US.UTF-8

Export LANGUAGE=en_US.UTF-8

Then source:

. ~ / .bashrc

At this point, the SVN operation will not report the error of svn: Can't convert string from 'UTF-8' to native encoding: again.

Another solution.

The solution is simple: set the locale of the current system correctly:

Export LC_CTYPE= "zh_CN.UTF-8"

Then re-checkout it.

Note that if you set variables according to your system character set, if zh_CN.UTF-8 fails, you may have to change it to GB2312:

Export LC_CTYPE= "zh_CN.GB2312"

In addition, some variables have different names, using:

Export LANG= "zh_CN.UTF-8"

At this point, I believe you have a deeper understanding of "how to solve the error Can't convert string from when Linux uses SVN". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Files Times systems coding content methods variables characters methods Chinese paths errors problems learning different no practical deeper one line interest Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Redmi OPPO Reno Microsoft Shulou Information