Bug #9206 | "characterEncoding=UTF-8" broken ("UTF8" works though) | ||
---|---|---|---|
Submitted: | 15 Mar 2005 22:00 | Modified: | 16 Mar 2005 21:06 |
Reporter: | Jon Andersen | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | 3.1.7 | OS: | Windows (Windows) |
Assigned to: | Mark Matthews | CPU Architecture: | Any |
[15 Mar 2005 22:00]
Jon Andersen
[15 Mar 2005 23:06]
Mark Matthews
Jon, This is a bug in that characterSetResults does not allow UTF-8, because it's passed directly to the server (but characterEncoding does, because there's quite a bit of code surrounding to convert canonical forms to names that the MySQL server understands). However, there really is no reason to force characterSetResults unless you're using a character encoding that's not known by the JDBC driver. Since UTF-8 is known by JDBC, the driver will use the character sets that the server tells it to via the field-level metadata for a result set.
[15 Mar 2005 23:08]
Mark Matthews
P.S. Please post _full_ stack traces with your bug reports, unless they contain sensitive information. If they are sensitive, you can attach them as a file which only MySQL developers can see. Full stack traces help us see problems much clearer and thus resolve bugs quicker.
[15 Mar 2005 23:23]
Jon Andersen
Mark, Thanks so much for your prompt response to this bug report! We will take your word for it, that removing "characterSetResults=UTF-8" will have no ill effects. Our database is set to UTF-8 so if it works like you said it does, there will be no problems. I did some preliminary testing and it appears that your workaround is fine. P.S. Note that this is a new bug, it didn't affect Connector/J 3.0.16.
[16 Mar 2005 16:59]
Anthony Whyte
On clarification regarding the suggested fix: you need not specify "UTF8" in place of "UTF-8" for the parameter value of parameter "characterEncoding" so long as you drop from your connection string the parameter "characterSetResults" as in sql.connect=jdbc:mysql://127.0.0.1:3306/[mydbname]?useUnicode=true&characterEncoding=UTF-8
[16 Mar 2005 21:06]
Mark Matthews
This is fixed for version 3.1.8.