问题描述
我的 Eclipse 工作区有两个项目,一个使用 CVS,另一个使用 Git.修改CVS项目中的文件并保存时,弹出窗口说
期间发生内部错误:计算存储库 repo23 的 Git 状态".格式错误的输入或输入包含无法映射的字符:/Users/pb/repo23/对照表/feng11.htm
知道如何解决这个问题吗?
Eclipse 平台
版本:4.3.1.v20130911-1000版本号:M20130911-1000
Eclipse EGit 3.2.0.201312181205-r
您可以在 这个问题:
java.nio.file.InvalidPathException:格式错误的输入或输入包含无法映射的字符:/Users/jettykoo/Desktop/WeTeam/Git/WSS/MaryKay/Doc/01/.DS_Store在 sun.nio.fs.UnixPath.encode(UnixPath.java:147)在 sun.nio.fs.UnixPath.(UnixPath.java:71)在 sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281)在 java.io.File.toPath(File.java:2186)在 org.eclipse.jgit.util.FileUtil.isFile(FileUtil.java:126)在 org.eclipse.jgit.util.FileUtil.canExecute(FileUtil.java:131)
我对 sun/nio/fs/UnixPath.java :'字符'而不是'字符'!
如这个 NetBeans 问题中所述(这应该与Eclipse 上下文):
<块引用>这是一个 JDK 问题还有部分 Apple 问题(LC_CTYPE
默认未设置).
终端中的行为取决于 Terminal.app
首选项.
- 当终端导出
LC_CTYPE
设置为UTF-8
时,它在终端中工作正常,因为sun.jnu.encoding
设置为LC_CTYPE
的值. - 如果未设置,则不起作用.
设置sun.jnu.encoding
的问题是可能会被JDK覆盖,所以导出LC_CTYPE=UTF-8
比较安全.
而不是将 -J-Dsun.jnu.encoding=UTF-8
添加到 netbeans.conf
,添加导出 LC_CTYPE=UTF-8
代码>到它.
您可以在 eclipse.ini (-DLC_CTYPE=UTF-8
).
Alexander Kachkaev 提到了 在评论中:
<块引用>帮助我的是在 eclipse.ini
中添加了两行.
-DLC_CTYPE=UTF-8-Dfile.encoding=UTF-8
<块引用>
团队命令停止出错
My Eclipse workspace has two projects, one using CVS, the other Git. When modifying a file in the CVS project and save, a pop-up window appear saying
An internal error occurred during: "Computing Git status for repository repo23".
Malformed input or input contains unmappable chacraters: /Users/pb/repo23/对照表/feng11.htm
Any idea how to fix this?
EDIT:
Eclipse Platform
Version: 4.3.1.v20130911-1000 Build id: M20130911-1000
Eclipse EGit 3.2.0.201312181205-r
You can see the exact call stack in this issue:
java.nio.file.InvalidPathException: Malformed input or input contains unmappable chacraters: /Users/jettykoo/Desktop/WeTeam/Git/WSS/MaryKay/Doc/01/.DS_Store
at sun.nio.fs.UnixPath.encode(UnixPath.java:147)
at sun.nio.fs.UnixPath.<init>(UnixPath.java:71)
at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281)
at java.io.File.toPath(File.java:2186)
at org.eclipse.jgit.util.FileUtil.isFile(FileUtil.java:126)
at org.eclipse.jgit.util.FileUtil.canExecute(FileUtil.java:131)
I was surprised by the typo in sun/nio/fs/UnixPath.java : 'chacraters' instead of 'characters'!
As mentioned in this NetBeans issue (which should be relevant in an Eclipse context):
it's a JDK issue and also partially also Apple issue (the
LC_CTYPE
is not set by default).
The behaviour in terminal depends on theTerminal.app
preferences.
- When the Terminal export
LC_CTYPE
set toUTF-8
it works fine in terminal as thesun.jnu.encoding
is set to the value ofLC_CTYPE
.- When it's not set it does not work.
The problem with setting the
sun.jnu.encoding
is that it may be overwritten by the JDK, so it's safer to export theLC_CTYPE=UTF-8
.Rather then addding
-J-Dsun.jnu.encoding=UTF-8
tonetbeans.conf
, prepend the exportLC_CTYPE=UTF-8
to it.
You could set this in your eclipse.ini (-DLC_CTYPE=UTF-8
).
Alexander Kachkaev mentions in the comments:
What helped me was adding two lines to
eclipse.ini
.
-DLC_CTYPE=UTF-8
-Dfile.encoding=UTF-8
Team commands stopped giving errors
这篇关于Git 错误:格式错误的输入或输入包含无法映射的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!