Git 错误:格式错误的输入或输入包含无法映射的字

Git error: Malformed input or input contains unmappable chacraters(Git 错误:格式错误的输入或输入包含无法映射的字符)
本文介绍了Git 错误:格式错误的输入或输入包含无法映射的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 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 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 错误:格式错误的输入或输入包含无法映射的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to make Eclipse compile patched modules on JDK 9+ by passing the --patch-module javac option to my project compiler? (see pic)(如何通过向我的项目编译器传递--patch-MODULE javac选项,让Eclipse在JDK 9+上编译打了补丁的模块?(见图))
Eclipse feature patch doesn#39;t patch plugins(ECLIPSE功能补丁不会补丁插件)
Failed Autowired of BuildProperties Spring Boot 2.1.5 amp; eclipse(自动连接BuildProperties Spring Boot 2.1.5失败//eclipse)
how to export openlayer3 map to png with its scale bar using js(如何使用js将Open layer3地图及其比例尺导出为PNG)
How can I play mp4 with vlcj?(如何用VLCJ播放MP4?)
quot;Go to definitionquot; from PyDev not work in External Library files(从PyDev转到DefinitionQuot;Not Work in Extral Library Files(Q;转到定义Q;;不在外部库文件中工作))