How to solve the Chinese problem in jsp MySQL

Source: Internet
Author: User

The following article describes how to solve the Chinese problem in jsp MySQL and how to describe the actual application code in actual operations, if you are interested in solving the Chinese problem in jsp MySQL, the following articles will satisfy your curiosity.

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 zookeeper defined in JSPMySQL is not a UTF-8.

It's a pity that MySQL does not yet have 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" %>  

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.

Jsp 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” %>  

Http://www-900.ibm.com/developerWorks/cn/java/java_chinese/index.shtml reference this article

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

Original article title: jsp MySQL Chinese problems

Connection: http://www.cnblogs.com/bobomail/archive/2005/03/18/121068.html

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.