简体   繁体   中英

cakephp sending encrypted data to library from Controller

While working with the cakephp, I found an issue mentioned below.

  1. Fetched the encrypted field info from DB (encrypted using Security::rijndael)
  2. Passed this whole data as an array format to the custom Library(Own created lib).

When i echoed the data in lib as well in controller I amazed to see the result. The value (encrypted one) are showing blank in the lib. Is I missed anything in codding? I searched on google but didn't get the satisfactory answer, Please help me out. Your help will really be appreciated.

Here is result i am getting in controller and Library respectively

Array
(
    [0] => Array
        (
            [value] => s�i�(�RTf���cBЉF� | �r�n@ô�
        )
)

Array
(
    [0] => Array
        (
            [value] =>
        )
)

Check your character encoding; a place I worked at ran into a similar issue and it was due to our db trying to encode characters it did not support. UTF-8 generic is a, well, generic encoding type.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM