【问题标题】:Apache Ant scp corrupts UTF-8?Apache Ant scp 破坏了 UTF-8?
【发布时间】:2014-06-30 23:58:15
【问题描述】:

我想用ant构建我的web项目,通过scp复制到服务器上。

构建分为三个步骤:

  1. 收集数据
  2. 通过 scp 复制收集的数据
  3. 干净

问题是第 2 步以某种方式损坏了我的 utf-8 文件(我收到了很棒的“标头已由”错误消息发送)。

如果我跳过第 2 步和第 3 步并使用 WinSCP 自己复制收集的文件,一切正常。这意味着:ant copy 命令可以正常工作。

不能正常工作的是ant scp命令:

<scp todir="${remote_user}:${remote_password}@${remote_host}:${remote_basepath}/core" trust="true" failonerror="yes">
    <fileset dir="${build_root}/core/">
        <include name="${core_src}/" />
    </fileset>
</scp>

我正在使用带有内置 ant 插件的 Windows 7 和 Eclipse 4.3 (Kepler)。

到目前为止我尝试了什么: - 复制时设置编码和输出编码属性 - 在 JRE 选项卡上的构建配置中设置 -Dfile.encoding=UTF8 - 尝试了 jre7,但后来我遇到了 Keberus 错误。所以还是用jre6

我希望有人可以帮助我:)

【问题讨论】:

    标签: java ant utf-8 build scp


    【解决方案1】:

    解决了。

    我在 windows-1252 上工作的时间太长以至于错过了:UTF-8 with BOM = NOT GOOD

    我所有的文件都有那个 BOM。蚂蚁做的一切都是正确的。 WinScp 删除了 BOM

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-15
      • 2015-07-22
      • 2017-04-25
      相关资源
      最近更新 更多