Problem with displaying standard keyboard emojis android/IOS

Hi there,
I have an application where user can upload feed.
User can add Image and description.
In the description the user can add text + emojis from the standard keyboard.

But when the user adds emojis they are not displayed at all.
What can be the problem?

How can I submit this emojis properly to the server and show them on the HTML page?

Here is my save function:

save(){
    this.serverApiRequest.setUpdateBusinessFeedItem({
      user_id: this.userData['id'],
      id: this.imageData.id,
      description: this.imageData.description_textarea
    }).subscribe((data) => {
  }

And here I send it to the service:

setUpdateBusinessFeedItem(data){ 
    let headers = new Headers({
			'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
		});
		let options = new RequestOptions({
			headers: headers
    });

    let body = "method=setUpdateBusinessFeedItem&userData="+JSON.stringify(data);
              
    return this.http.post(this.globals.apiUrl, body, options)
    .map(this.extrectData)
    .do(this.logResponse)
    .catch(this.catchError);
  }

In the DB it looks like this:

OK

I found the solution for this problem.

It all is with the DB charset configuration and the Connection charset config

I am using MySql as a DB so I did this:

Alter the table to:

utf8mb4 / utf8mb4_unicode_ci

Alter the field to:

utf8mb4 / utf8mb4_unicode_ci

And the PHP conection to:

$mysqli->set_charset("utf8mb4");

Cool
:grinning: :grin: :joy: :rofl: :smiley: :smile: :sweat_smile: :laughing:

1 Like