Skip to content

Commit cf959fc

Browse files
Merge pull request #135 from jffifa/bugfix-for-utf8mb4
bugfix for decoding values of columns in charset "utf8mb4"
2 parents 56ab0fd + af256c5 commit cf959fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pymysqlreplication/row_event.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import datetime
66

77
from pymysql.util import byte2int
8+
from pymysql.charset import charset_to_encoding
89

910
from .event import BinLogEvent
1011
from .constants import FIELD_TYPE
@@ -194,7 +195,7 @@ def __add_fsp_to_time(self, time, column):
194195
def __read_string(self, size, column):
195196
string = self.packet.read_length_coded_pascal_string(size)
196197
if column.character_set_name is not None:
197-
string = string.decode(column.character_set_name)
198+
string = string.decode(charset_to_encoding(column.character_set_name))
198199
return string
199200

200201
def __read_bit(self, column):

0 commit comments

Comments
 (0)