File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -46,11 +46,12 @@ function ColumnDefinition (packet)
46
46
47
47
packet . skip ( 1 ) ; // length of the following fields (always 0x0c)
48
48
this . characterSet = packet . readInt16 ( ) ;
49
+ this . encoding = CharsetToEncoding [ this . characterSet ] ;
49
50
50
51
// TODO: use this.characterSet to get proper encoding
51
52
// May be keep it cesu8 since MySQL meta data is actually cesu8
52
53
// https://github.com/sidorares/node-mysql2/pull/374
53
- this . name = StringParser . decode ( this . _buf . slice ( _nameStart , _nameStart + _nameLength ) , 'cesu8' ) ;
54
+ this . name = StringParser . decode ( this . _buf . slice ( _nameStart , _nameStart + _nameLength ) , this . encoding ) ;
54
55
55
56
this . columnLength = packet . readInt32 ( ) ;
56
57
this . columnType = packet . readInt8 ( ) ;
@@ -62,7 +63,7 @@ var addString = function (name) {
62
63
Object . defineProperty ( ColumnDefinition . prototype , name , { get : function ( ) {
63
64
var start = this [ '_' + name + 'Start' ] ;
64
65
var end = start + this [ '_' + name + 'Length' ] ;
65
- return this . _buf . utf8Slice ( start , end ) ;
66
+ return StringParser . decode ( this . _buf . slice ( start , end ) , this . encoding ) ;
66
67
} } ) ;
67
68
} ;
68
69
You can’t perform that action at this time.
0 commit comments