.

问题描述 投票:5回答:4
If IntelliJ IDEA still thinks that this file has BOM, please

file an issue

with the steps to reproduce.

ide utf-8 intellij-idea byte-order-mark
4个回答
6
投票

Right click on a file in the project tree,click on "Remove BOM"(Not sure if it exists on the base platform, comments will be helpful)

FileI had the same Problem.SynchronizeI found this issue and a "works for me"-fix:

http: 我想在Intellij IDEA中删除我的UTF-8文件中的Bite Order Masks,我该怎么做?

问题是,如果我试图通过其他编辑器(如Akelpad)来做,当我后来在IDEA中修改文件时,它会以某种方式记住BOM的存在,并再次将其添加到我的文件中(((

8
投票

我想在Intellij IDEA中删除UTF-8文件中的咬合顺序掩码,如何才能做到这一点?问题是,如果我试图通过其他编辑器(如Akelpad)来做,当我稍后修改文件时......

在Intellij IDEA中,没有这样的操作来删除UTF-8文件中的BOM。有一个bug,就是

BOM被移除

0
投票

当你从外部删除BOM时,请确保文件与编辑器同步,可以试一下

/youtrack.jetbrains.comissueIDEA-86880#comment=27-386505。希望能帮到你


0
投票

以下的技巧对我来说是有效的

1)创建新的空文件(例如:temp123.java)。

2) 确保该文件的代码-页面编码为UTF-8。

3)将原来的内容全部复制到新创建的文件中(选择全部,复制,转到另一个标签页,粘贴)并保存。

我参考了下面的链接,可以结合Intellij Idea File->File Encoding->ReloadConvert to UTF-8。

IDEs支持。如何从文件中删除BOM?

© www.soinside.com 2019 - 2024. All rights reserved.