mysqljsp

I want mysql table to support two languages


I have a jsp form, there is the next line in the code:

<%@page contentType="text/html" pageEncoding="UTF-8"%>

I send the parameters of the form into a table in mysql.

the parameters can be in english or hebrew.

I looked if mysql supports the hebrew language:

show character set;

and got:

| hebrew   | ISO 8859-8 Hebrew           | hebrew_general_ci   |      1 |

but, when I inserts parameters in hebrew, the fit in mysql shows something like:

╫⌐╫?╫?╫?╫?╫?

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?


Solution

  • 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;