php - storing string that has unicode character in it -


i have string has following content:

  \ud83c\udf80new stuff \u0026 second stuff\n\ud83d\udcf1sms\/ kik : 085738566676 \/ veinshop\n\u26d4 item exclude ongkir\n\u2708shipping mon-fri\n\ud83d\udcb0bca only\n\ud83d\ude90jne\n\ud83c\udfe1 denpasar-bali 

i wanted store in mysql database gives me empty. using doctrine2 orm interface database. here's entity string property:

class shop {   /**      *      * @var string      * @orm\column(name="bio", type="string", nullable=true)      */     private $bio;   /**      * set bio      *      * @param string $bio      * @return instagramshop      */     public function setbio($bio)     {         $this->bio = $bio;          return $this;     }      /**      * bio      *      * @return string       */     public function getbio()     {         return $this->bio;     } } 

when set shop entity bio , call persist on entity. stored value null. i've set table collation utf8mb4 , charset in dbo utf8mb4

you have config looks this:

doctrine:     dbal:         default_connection: default         connections:             default:                 dbname: %database_name%                 ...                 charset: utf8mb4 

make sure charset set utf8mb4. connection collation.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -