Solutions to some Chinese problems in jsp MySQL

Source: Internet
Author: User

The following articles mainly introduce the solutions to some Chinese problems of jsp MySQL. The actual application proportion of jsp MySQL is still the majority. If you are curious about this technology, the following articles will unveil its mysteries. The following is a detailed description of the relevant content.

Jsp MySQL does not seem to support UTF-8 and unicode

Using UTF-8 is actually true for JSP

For websites, it is often necessary to import or export documents from multiple countries.

It is more convenient than others.

In fact, you can still set the parameter settings of JSP, as long as you remember to add them.

Otherwise, the JSP internal handler is not a UTF-8.

But unfortunately, jsp MySQL has not yet had a complete support UTF-8

But don't be discouraged.

Utf8 needs to be added on the page

 
 
  1. <%@ page contentType="text/html;charset=utf-8" %>  

Reference

Java uses unicode to display Chinese including UTF-8 and UTF-16

When developing applications based on the Java programming language, we must inevitably process Chinese characters. The default encoding method of Java programming language is UNICODE, and the databases and files we usually use are all encoded Based on GB2312.

Sp Chinese display is required

Another problem is that Chinese characters are correctly encoded and converted during Java programming. For example, when you output a Chinese string to a webpage

Out. println (string); still used

<% = String %>, must be converted from UNICODE to GBK, either manually or automatically. In JSP 1.0, you can define the output character set to automatically convert the internal code. Usage is

 
 
  1. <%@page contentType=”text/html;charset=gb2312” %>  

The above content is an introduction to the Chinese issue of jsp MySQL. I hope you will have some gains.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.