Broken handling of non-ASCII characters in SQL queries #4

Merged
merged 1 commit into from Apr 18, 2012

Projects

None yet

2 participants

Contributor

The following SQL query breaks in the current version:

SELECT 'åäö'

Seems to be caused by confusion regarding bytes and characters in the Utils class, but perhaps it is found elsewhere in the project as well.

Couldn't really verify this, since I don't have a Drizzle installation (to run the tests on). Just using Drizzle JDBC for MySQL connectivity right now.

@cederberg cederberg Fixed a bunch of broken string iteration code.
The assumption that 1 char == 1 byte is incorrect for UTF-8 strings. Hence all iteration should
be performed on proper Java characters, not UTF-8 bytes. This seems to be broken in several
places in the project.
12bc1a4
Owner
krummas commented Apr 18, 2012

could not reproduce the bug (ie selecting åäö works for me) , but your code is alot cleaner, thanks!

@krummas krummas merged commit da9085b into krummas:master Apr 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment