Solved my problem. MySQL driver problem.

After putting this into my MySQL connection url it works! :-)
"useUnicode=true&characterEncoding=ISO-8859-1"

The problem seems to be, that the MySQL JDBC driver tries to determine
the character encoding automatically if not specify. Because my Solaris
server has a English setup the driver "speaks" with the wrong character
set as the autodetect must return ISO-8859 encoding, I guess. If I set
to ISO-8859-1 all german characters coming from the MySQL DB are
received correctly in my DAO classes. 

The problem wasn't JSP/Tomcat/Struts whatever, it was the MySQL driver
and my lack of reading the documentation (well that's an answer for
nearly all question...)

Anyway thx
Michael

> -----Original Message-----
> From: mech [mailto:[EMAIL PROTECTED]] 
> Sent: Dienstag, 4. Februar 2003 13:08
> To: 'Struts Users Mailing List'
> Subject: RE: HTML entities (general Struts taglib problem 
> with language entities)
> 
> 
> > 
> > Hey Michael,
> > 
> > that's right, if you define your JSP content as utf-8, it
> > will be interpreted as utf-8. So your text comming from the 
> > DB *must* be utf-8 as well. If you use a different character 
> > set in you DB, you could use a transformer, which transforms 
> > this character set into utf-8. Then you don't have to worry 
> > about correct displaying in the browser.
> 
> It's a bit strange...
> I just did the following in my main tiles jsp which is always 
> loaded: <%@ page contentType="text/html; charset=ISO-8859-1" 
> %> and even <meta http-equiv="content-type" 
> content="text/html; charset=ISO-8859-1">
> 
> So my fellow English Solaris even does german characters correct
> 
> I tested normal html öüä and it's fine.
> I tested
> <bean:define id="test" value="üöä"/>
> <bean:write name="test" filter="true"/>
> <bean:write name="test" filter="false"/>
> 
> and both writes work correct, the html source code shows that 
> no filtering auf ü into &uuml; has taken place at all. Anyway 
> the german character are displayed correctly.
> 
> But when I have text field originally coming from my MySQL 
> database on that Solaris machine that I want to display with 
> <bean:write> I encounter problems and receive only "?" in my 
> html source.
> 
> Only <bean:write filter="false" in combination with data 
> fields containing "abcd&uuml;efg&auml;test" works fine. With 
> <bean:write filter="true"> the & get's converted to &amp;
> 
> If I have data fields with "abcdefüöäsdfs" it always get's 
> garbled to "?" in html code.
> 
> I have no idea if this is more a mysql problem than a 
> Tomcat/Struts issue since my above tests work fine as long as 
> the data is not from db? Maybe it gets garbled in my database 
> DAO classes already while querying the db... no idea...
> 
> > 
> > I would always use a resource bundle for your texts, no
> > matter if you use only German. The special characters in the 
> > resource bundle could use HTML encoding, so you don't have to 
> > care about saving the properties files in utf-8. (We do it this way)
> I would do it, if i could rely on someone editing those 
> resource bundles later and using taglibs. But unfortunately I 
> have to use plain html saved as .jsp whereever possible for 
> latter maintenance of html-only folks.
> > 
> > You dont't have to save your JSPs in utf-8, since you don't
> > use special characters in the JSP code. You surely don't do 
> > that, right? Because the first 128 characters of ASCII or 
> > ANSI are identical to utf-8, you don't have to care about that.
> > 
> > Regards,
> > Bernhard
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to