-
1. mySQl encoding problem
jochen.schurich Apr 14, 2002 12:11 PM (in response to rsivanov)illegal XML characters have to be replaced by entity references:
use these:
< < less than
> > greater than
& & ampersand
' ' apostrophe
" " quotation mark
or use the CDATA section.
Everything inside a CDATA section is ignored by the parser.
If your text contains a lot of "<" or "&" characters - like program code often does - the XML element can be defined as a CDATA section.
A CDATA section starts with "<![CDATA[" and ends with "]]>"
your connect string inside the jboss.jcml should look like this:
jdbc:mysql://localhost/vertdiamond?useUnicode=true&characterEncoding=Cp1251
joe -
2. Re: mySQl encoding problem
ywhking Apr 15, 2002 12:02 PM (in response to rsivanov)Hi,joe
I encountered a strange problem and need your help.
I inserted a record in mySQL database by an EntityBean.Then when I querid it out it appeared mess.But when I restarted the jboss server,the data queried out appeared normal.
I think it may be that the jboss server get data from different place.The first time it get data from the instance pool,then when the server restarted,it get data from database.But in these two situations the data have different encoding.The first time it have the encoding of iso-8859-1(database default encoding),the second time it have the encoding of gb2312(local encoding).I have changed the charsetEncoding to iso-8859-1 in the file jboss.jcml according to your reply.But the problem still happened.
I don't know how to deal with this problem,could you please help me?
My platform is Win2k(Chinese) + jboss-2.4.4 + mySQL-3.23.47.
Thanks in advance.
ywhking