Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 85991 invoked from network); 24 Nov 2003 08:50:39 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 24 Nov 2003 08:50:39 -0000 Received: (qmail 33260 invoked by uid 500); 24 Nov 2003 08:49:54 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 33240 invoked by uid 500); 24 Nov 2003 08:49:53 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 33226 invoked from network); 24 Nov 2003 08:49:53 -0000 Received: from unknown (HELO kogut.o2.pl) (212.126.20.61) by daedalus.apache.org with SMTP; 24 Nov 2003 08:49:53 -0000 Received: from orion (bawa001.net.autocom.pl [213.134.175.152]) by kogut.o2.pl (o2.pl Mailer 2.0.1) with SMTP id F218F2EE91F for ; Mon, 24 Nov 2003 09:50:04 +0100 (CET) Message-ID: <005901c3b267$f2962e50$98af86d5@orion> From: "bwasko" To: "Tomcat Users List" References: <002b01c3b224$408942d0$98af86d5@orion> <3FC17DEA.1000604@comcast.net> Subject: Re: lame,encoding problem Date: Mon, 24 Nov 2003 09:50:01 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi I 've tried to execute insert statement that contains my national characters with the mysql command-line client tool and all looks ok. The strings are properly written into database. But writing into it with use of jdbc driver ends with chars like '??????'. I use mysql-connector and i think it causes these problems. Cheers Bartek ----- Original Message ----- From: "Christopher Schultz" To: "Tomcat Users List" Sent: Monday, November 24, 2003 4:41 AM Subject: Re: lame,encoding problem > Bartek, > > > But then when I do something with these > > parameters and my mysql database I get then them wrong encoded and > > all data read from mysql are wrong encoded . > > Hmmm... if you use your Java code to insert some text into the DB, does > it look okay when you read it back out using the mysql command-line > tool? I'm wondering if the characters are being mangled on the way into > of out of the database. > > See... the UTF-8 encoding only comes into play when converting bytes > from the request into Strings on which your Java code operates. Once > you're in the Java world, everything should be okay. Again, when you > write the data back out to the response, the UTF-8 comes into play as well. > > However, when writing to the db, the strings also need to be converted > to bytes by some character encoding. It's very possible that either the > VM and/or MySQL are using incompatible character sets. Check to see what > the value of the system property "file.encoding" is at runtime. > > Then again... unless you really are using multibyte characters, you > should be okay no matter what. The MySQL JDBC driver should be using the > same encoding going both to and from the db. But, if it's an encoding > that doesn't understand multibyte characters (like ISO-8859-1), then you > might be permanently damaging those characters. Though I use MySQL/Java > all the time, I'm not sure how to set the character encoding for the > JDBC driver. Check the MySQL documentation, and let us know what you find. > > Hope that helps, > -chris > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org