check charsetnr flag as well

This commit is contained in:
Brian Lopez 2010-04-01 14:45:58 -07:00
parent bbf7585d09
commit b5f22d7c05
1 changed files with 2 additions and 1 deletions

View File

@ -191,7 +191,8 @@ static VALUE rb_mysql_result_fetch_row(int argc, VALUE * argv, VALUE self) {
default: default:
val = rb_str_new(row[i], fieldLengths[i]); val = rb_str_new(row[i], fieldLengths[i]);
#ifdef HAVE_RUBY_ENCODING_H #ifdef HAVE_RUBY_ENCODING_H
if (fields[i].flags & BINARY_FLAG) { // rudimentary check for binary content
if ((fields[i].flags & BINARY_FLAG) || fields[i].charsetnr == 63) {
rb_enc_associate_index(val, binaryEncoding); rb_enc_associate_index(val, binaryEncoding);
} else { } else {
rb_enc_associate_index(val, utf8Encoding); rb_enc_associate_index(val, utf8Encoding);