"UTF-8 (charset is auto-detected from content)" when I want it to be ISO-8859-1

已回答

Settings dialog show Editor > File Encodings , Encoding as "UTF-8 (charset is auto-detected from content)" and is non-editable for an xml file without any hardcoded charset in the file. I need to have it encoded in ISO-8859-1. How can I change the encoding? The encoding in the status bar att the bottom of the Intellij window saying UTF-8 is greyed out.

0

You can specify encoding in the XML file prolog:

<?xml version="1.0" encoding="ISO-8859-1"?>
0

For different reasons I don’t want to use that hardcoding. I just want to tell Intellij what encoding it is by e.g. using the status bar item and set it to ISO-8859-1. Why is it greyed out?

If I open it in e.g. emacs it is recognized as ISO-8859-1; why does not Intellij do the same?

0

Hi, the issue is still not resolved, is there any workaround for jsp files?

0

Leopold12 Hub What's the problem with setting encoding in JSP files?

<%@ page contentType="text/html; charset=UTF-8" %>

0

The project Im on is encoded in windows-1252, I set the encoding as you said but Intellij keep encoding it in utf-8

0

Of course you need to specify the encoding you need in the JSP, just tried and it works:

 

0

I did that, sorry if I was unclear

The encoding indicator in the bottom right indicates utf-8 and the charset in the jsp header is windows-1252

0

Please contact support at https://intellij-support.jetbrains.com/hc/requests/new and attach a sample project to reproduce the issue.

Make sure you do not override the encoding in the IDE settings for this file.

1

请先登录再写评论。