[前][次][番号順一覧][スレッド一覧]

mysql:7686

From: Masaki Ikeda <Masaki Ikeda <masaki@xxxxxxxxxx>>
Date: Mon, 12 May 2003 19:27:55 +0900
Subject: [mysql 07686] Re: why certain Japanese characters are getting displayed as wrong characters?


Hi

On Mon, 12 May 2003 14:06:21 +0530
In why certain Japanese characters are getting displayed as wrong characters?
"eMantra Information" <info@xxxxxxxxxx> Wrote

> The data is entered in Japanese (Shift_JIS) in the html form and
> JSP stores the data in the MySQL database.

A special character as 2nd byte may come by ShiftJIS encoding.
for example, -- They are ', \ , etc.
Therefore, it will become inaccurate as SQL syntax, or some characters
will be corrupted.

There are two methods of solution.

1:Escape of the special character.
A character with a meaning special as SQL syntax will be escaped.
Which needs escape are '(0x27), "(0x22), \(0x5C) , and maybe %(0x25).

2: Use another encoding.
You may use UTF-8 or EUC-JP encoding instead of Shift_JIS encoding.
Probably this method is more easier.
However, this method may be unable to be taken if already have many data
by Shift_JIS, or have to use JIS X 0201 characters.

Since you are using Tomcat, I will think that JIS X 0201 characters is
throwing away from the beginning :-)

A special character is not used in UTF-8 or EUC-JP. Therefore, a problem
will not happen even if you do not do special processing.

best regards

# "Jap" is not shortening expression of "Japanese" but insult word.
# There may be some offended persons :-<
# Probably, it will be better not to use at a public place, although I
# have not made it mind so much.

--

Masaki Ikeda <masaki@xxxxxxxxxx>
    Orange System Co.


[前][次][番号順一覧][スレッド一覧]

      7684 2003-05-12 17:36 ["eMantra Information] why certain Japanese characters are getting displayed as wrong characters?
->    7686 2003-05-12 19:27 ┣[Masaki Ikeda <masaki]                                       
      7694 2003-05-13 16:02 ┃┗["eMantra Information]                                     
      7697 2003-05-13 16:27 ┃ ┗[Joel Rees <joel@xxxx]                                   
      7687 2003-05-12 19:45 ┗["Shimono Osamu" <shi]                                       
      7703 2003-05-14 15:47  ┗["eMantra Information]                                     
      7706 2003-05-14 17:27   ┣["Shimono Osamu" <shi]                                   
      7708 2003-05-14 18:14   ┗[Joel Rees <joel@xxxx]