Git错误:格式错误的输入或输入包含不可映射的chacraters [英] Git error: Malformed input or input contains unmappable chacraters

查看:726
本文介绍了Git错误:格式错误的输入或输入包含不可映射的chacraters的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Eclipse工作区有两个项目,一个使用CVS,另一个使用Git。当修改CVS项目中的文件并保存时,会出现一个弹出窗口,说出

 存储库repo23的Git状态。 
格式不正确的输入或输入包含不可映射的chacraters:/ Users / pb / repo23 /对照表/feng11.htm

任何想法如何解决这个问题?



编辑:



Eclipse Platform



版本:4.3.1.v20130911-1000
构建ID:M20130911-1000



Eclipse EGit 3.2.0.201312181205- r

解决方案

您可以在此问题

  java.nio .file.InvalidPathException:格式错误的输入或输入包含不可映射的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)
在java.io.File.toPath(File.java:2186)
在org.ec lipse.jgit.util.FileUtil.isFile(FileUtil.java:126)
在org.eclipse.jgit.util.FileUtil.canExecute(FileUtil.java:131)

我对 sun / nio / fs / UnixPath.java :'chacraters'而不是'



此NetBeans问题(它应该在Eclipse环境中相关):


它是一个 JDK问题 ,还部分还有Apple问题( LC_CTYPE 默认情况下不设置。

终端中的行为取决于 Terminal.app 首选项。




  • 当终端导出 LC_CTYPE 设置为 UTF-在 sun.jnu.encoding 中设置为$ code> LC_CTYPE

  • 当它没有设置它不工作。



设置 sun.jnu.encoding 的问题是它可能由JDK覆盖,所以导出 LC_CTYPE = UTF-8 更安全。



而不是添加 -J-Dsun.jnu.encoding = UTF-8 netbeans.conf ,前面输出 LC_CTYPE = UTF-8


您可以在 -DLC_CTYPE = UTF-8 )。






亚历山大·卡奇卡夫在评论中提到 a>:


有什么帮助我在 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 the Terminal.app preferences.

  • When the Terminal export LC_CTYPE set to UTF-8 it works fine in terminal as the sun.jnu.encoding is set to the value of LC_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 the LC_CTYPE=UTF-8.

Rather then addding -J-Dsun.jnu.encoding=UTF-8 to netbeans.conf, prepend the export LC_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错误:格式错误的输入或输入包含不可映射的chacraters的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆