Intellij Idea中如何删除BOM

发布于 2024-12-11 16:38:22 字数 161 浏览 0 评论 0原文

我想从我的
中删除咬合顺序面具 Intellij IDEA 中的 UTF-8 文件,我该怎么做?

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

I'd like to remove Bite Order Masks from my
UTF-8 files in Intellij IDEA, how can I do this?

The problem is that if I'm trying to do it via other editors (e.g. Akelpad),
when I modify the file later in IDEA it somehow remembers that BOM
was present and adds it to my file again (((

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

狼亦尘 2024-12-18 16:38:22

在 PHPStorm 8 上测试:

右键单击项目树中的文件,
单击“删除 BOM”

(不确定基础平台上是否存在,评论会有所帮助)

Tested on PHPStorm 8:

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)

嗫嚅 2024-12-18 16:38:22

IntelliJ IDEA 中没有从 UTF-8 文件中删除 BOM 的操作。有一个错误,BOM 被删除,但它很早以前就被修复了。

当您从外部删除 BOM 时,请确保文件与编辑器同步,尝试 File | 同步

如果 IntelliJ IDEA 仍然认为此文件具有 BOM,请提出问题并提供重现步骤。

There is no such action to remove BOM from UTF-8 files in IntelliJ IDEA. There was a bug that BOM is removed, but it was fixed a long time ago.

When you remove BOM externally, make sure the file is synchronized with editor, try File | Synchronize.

If IntelliJ IDEA still thinks that this file has BOM, please file an issue with the steps to reproduce.

落日海湾 2024-12-18 16:38:22

Intellij Idea 有一个选项,文件 -> 删除 Bom,但它看起来效果不太好,我收到“此文件具有强制 Bom”错误

以下提示对我有用

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

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

3)将整个内容从原始文件复制到新创建的文件(选择全部,复制,转到>另一个选项卡,粘贴)并保存

我引用的链接如下,可以与Intellij Idea文件->文件编码->结合使用重新加载/转换为 UTF-8

IDE 支持:从文件中删除 BOM - 如何操作?

Intellij Idea has an option, File->Remove Bom, but it looks doesn't work very well, I got "This file has mandatory Bom" error

The following tips work for me

1) create new empty file (for example: temp123.java)

2) make sure that code-page/encoding for that file is UTF-8

3) copy whole content from original to newly created file (select all, copy, go > to another tab, paste) and save

I referenced link below, can be combined with Intellij Idea File->File Encoding-> Reload/Convert to UTF-8

IDEs Support: Remove BOM from file - how ?

情深已缘浅 2024-12-18 16:38:22

我有同样的问题。

我发现了这个问题并且“对我有用”修复:
http://youtrack.jetbrains.com/issue/IDEA-86880#comment =27-386505

希望有帮助

I had the same Problem.

I found this issue and a "works for me"-fix:
http://youtrack.jetbrains.com/issue/IDEA-86880#comment=27-386505

Hope it helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文