我希望mysql表支持两种语言 [英] I want mysql table to support two languages
本文介绍了我希望mysql表支持两种语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个jsp表单,代码中有下一行:
I have a jsp form, there is the next line in the code:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
我将表单的参数发送到mysql中的表中.
I send the parameters of the form into a table in mysql.
参数可以是英语或希伯来语.
the parameters can be in english or hebrew.
我查看了mysql是否支持希伯来语:
I looked if mysql supports the hebrew language:
show character set;
并得到:
| hebrew | ISO 8859-8 Hebrew | hebrew_general_ci | 1 |
但是,当我在希伯来语中插入参数时,mysql中的拟合显示如下:
but, when I inserts parameters in hebrew, the fit in mysql shows something like:
╫⌐╫?╫?╫?╫?╫?
我也在尝试在我的jsp文件中打印参数并收到奇怪的字母..
I am trying also to print the parameters in my jsp file and got strange letters..
如何更新代码以支持英语和希伯来语?
how can I update my code in order to support english and hebrew?
推荐答案
作为以utf-8编码创建新表的示例,这应该对您有用;
As an example to create a new table with utf-8 ecoding, this should work for you;
CREATE TABLE IF NOT EXISTS `test` (
`id` int(10) NOT NULL,
`name` varchar(10)
collate utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
这篇关于我希望mysql表支持两种语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文