zengkid / SmartTomcat

The Tomcat plugin for Intellij IDEA
Apache License 2.0
126 stars 55 forks source link

Default encoding - charset #77

Closed jcomas closed 3 years ago

jcomas commented 3 years ago

Describe the bug Default character encoding doesn't set to UTF-8. No effect into servlet using: response.setContentType("application/json; charset=UTF-8");

Screenshots If applicable, add screenshots to help explain your problem.

Intellij & SmartTomcat Version (Help -> About copy & paste below) IntelliJ IDEA 2021.2.3 (Community Edition) Build #IC-212.5457.46, built on October 12, 2021 Runtime version: 11.0.12+7-b1504.40 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 10 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 12 Non-Bundled Plugins: de.docs_as_co.intellij.plugin.diagramsnet (0.1.11), net.seesharpsoft.intellij.plugins.csv (2.18.0), com.vermouthx.idea (1.12.2), Dart (212.5486), com.markskelton.one-dark-theme (5.4.0), uk.me.jeffsutton.restconsole (1.4), com.poratu.idea.plugins.tomcat (3.8.5), io.flutter (61.2.4), DBN (3.2.5713.0), com.caldonazzi.alessandro.uml (0.2.0), com.godwin.json.parser (1.4.2), org.jetbrains.kotlin (212-1.5.31-release-546-IJ4638.7), cn.cloud.auto.restful.tool (1.4.4) Kotlin: 212-1.5.31-release-546-IJ4638.7

jcomas commented 3 years ago

Working ok if you set in Java Servlet:

response.setContentType("text/html; charset=UTF-8"); and after response.setContentType("application/json; charset=UTF-8");

but it fails if you type: response.setContentType("text/html"); and after response.setContentType("application/json; charset=UTF-8");