
Solution to java displaying garbled characters:
1. The browser calls jsp, html and other pages display garbled characters in Chinese
This situation needs to meet two requirements:
(1) The file itself is edited and saved in utf-8 (right click on the properties in myEclipse and select utf-8)
(2 ) The browser uses utf-8 to parse:
(manual)==> Right-click in the browser and select the encoding format as utf-8
(smart)==> Write in the file For example: Use the tag to simulate the response header, which tells the browser to use UTF-8 encoding and parsing
(Smart)==> response.setContentType("text/html;charset=UTF-8"); tells the browser to use UTF-8 encoding analysis
Commonly used:
<meta>或<meta> <?xml encoding="UTF-8"?>
For more java knowledge, please pay attention to the java basic tutorial column.
The above is the detailed content of Solution to garbled code displayed in java. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version
Recommended: Win version, supports code prompts!

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools





