Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FBStringField.setBoolean and MBCS [JDBC112] #152

Closed
firebird-automations opened this issue Mar 3, 2008 · 2 comments
Closed

FBStringField.setBoolean and MBCS [JDBC112] #152

firebird-automations opened this issue Mar 3, 2008 · 2 comments

Comments

@firebird-automations
Copy link

Submitted by: @asfernandes

Assigned to: Roman Rokytskyy (rrokytskyy)

This method is defined as:
if (field.sqllen == 1)
setString(value ? SHORT_TRUE : SHORT_FALSE);
else
if (field.sqllen > 4)
setString(value ? LONG_TRUE : LONG_FALSE);

If my string field uses a MBCS (for example, UTF-8) or my connection charset is multi-byte, the above code didn't work (due to sqllen be defined in number of bytes) and also didn't throw a exception.

The solution is to divide sqllen by the number of max. bytes of the field character set.

Commits: 4bd389f

@firebird-automations
Copy link
Author

Modified by: Roman Rokytskyy (rrokytskyy)

Fix Version: Jaybird 2.2 [ 10053 ]

@firebird-automations
Copy link
Author

Modified by: Roman Rokytskyy (rrokytskyy)

status: Open [ 1 ] => Closed [ 6 ]

resolution: Fixed [ 1 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant