且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法将字符串从“ UTF-8”转换为本地编码

更新时间:2023-11-27 11:18:04

仅JavaHL SVN的包装。如我所见,JavaHL调用svn命令(svn diff ...)并解析返回的消息。您尝试执行的命令将返回该diff中某些属性已更改的信息(德语Eigenschaftsänderung)。不幸的是,处理该呼叫的终端弄乱了编码。结果是 RA层请求失败(ZM-Schicht Anforderung gescheitert),这仅表示JavaHL无法解析返回的消息。

JavaHL is only a wrapper to SVN. As i see it JavaHL calls the svn command (svn diff...) and parses the returned message. The command you try to execute returns the info that in this diff some property changed (in german Eigenschaftsänderung). Unfortunately the terminal which handled the call messed up the encoding. The result is a "RA layer request failed" (ZM-Schicht Anforderung gescheitert) which simply means that JavaHL was not able to parse the returned message.

可以尝试的事情:


  1. 使用 LC_MESSAGES = en_US.UTF-8 / path / to / eclipse开始蚀/ eclipse ,也许JavaHL会调用带有英文消息的svn可执行文件

  1. start eclipse with LC_MESSAGES="en_US.UTF-8" /path/to/eclipse/eclipse and maybe JavaHL will call the svn executable with english messages

检查启动Eclipse的终端。它支持unicode吗? (rxvt不会,urxvt会在其中)

check the terminal from which you start Eclipse. Does it support unicode? (rxvt does not, where urxvt does)

在终端中输入ä并检查输出。您应该看到ä为可读字符。从我的输出中可以看到,字符应编码为\303\244而不是\195\164(303是195的八进制表示形式(十进制为195,而244(oct)== 164(dec))

type ä in your terminal and check the output. You should see the ä as readable character. As you can see from my output the character should be encoded as \303\244 and not \195\164 (303 is the octal representation for 195 in decimal, and 244(oct) == 164(dec))

$ ä
bash: $'\303\244': command not found


希望这会有所帮助。