Mysql触发器插入用问号替换unicode(???)

时间:2018-01-26 07:53:11

标签: mysql unicode triggers

我有2个表homeworktrigger。当在homework中插入新行时,我触发它将homework列文本(unicode)插入到trigger表中。在homework表中,unicode是正确的,但在trigger表中,unicode文本正在替换为问号(???)

像这样:

Eng- ????? ????? ????? q???????????    f???? ?????? ?????. (Tamil language test)#Kan: ???? ???? ?????? ????????? ???? ?????????? ????? ??????? #ACC: ???? ???? ?????? ????????? ???? ?????????? ????? ??????? 

trigger表格列collationutf8_unicode_ci,与homework表格列相同

(来自评论)

CREATE TABLE trigger (
    TriggerId int(100) NOT NULL AUTO_INCREMENT, 
    TableName varchar(200) NOT NULL, 
    Homework mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
    SchoolId int(100) NOT NULL, 
    DateTimeRecordInserted timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 
    PRIMARY KEY (TriggerId), 
    KEY TriggerId (TriggerId)
) ENGINE=InnoDB AUTO_INCREMENT=1247487 DEFAULT CHARSET=latin1

1 个答案:

答案 0 :(得分:1)

  

DECLARE var_row_data MEDIUMTEXT CHARACTER SET utf8;