yii2mod / yii2-comments

Comments module for Yii2
MIT License
158 stars 63 forks source link

malformed utf-8 characters possibly incorrectly encoded php #23

Closed mkhalil49 closed 8 years ago

mkhalil49 commented 8 years ago

When add a comment gives me malformed utf-8 characters possibly incorrectly encoded

and i resolved it by

  $decryptEntity = Yii::$app->getSecurity()->decryptByKey(utf8_decode($entity), $module::$name);

and

return utf8_encode(Yii::$app->getSecurity()->encryptByKey(Json::encode([
            'entity' => $this->entity,
            'entityId' => $this->entityId,
            'relatedTo' => $this->relatedTo
        ]), Module::$name));

thanks

ihorchepurnyi commented 8 years ago

Hi, how i can reproduce your issue?

mkhalil49 commented 8 years ago

i am using Arabic language my encoding utf-8 but when i add the comment gives me that error when i searched i found a similar issue that helped me fix that http://stackoverflow.com/questions/29191580/how-can-i-save-an-encrypted-data-using-yiiapp-security-encryptbykey-in-yi

ihorchepurnyi commented 8 years ago

issue was fixed, please update the package via composer update command.