I'm writing a WP plugin that connects to another WP sites, and get some data in return (some formidable entries, with names and other stuff).
Everything works great, and my plugin basicly works as its supposed to - but i noticed today that it have some strange encoding issue - i live in a nordic country, so ø æ l, is pretty common in names.
i have been debugging for the past 2 hours, but cant seem to figure out what is wrong.
**Data path:**
End-point -> Plugin - \00f8
Data received - \u00f8
Data saved - u00f8
i receieve the data with the following code:
$aDataRecevied = json_decode(oaal_CallEndpointAPI('GET', 'xxxxxx.dedi2491.your-server.de/wp-json/oaeu/v1/api', $aDataSend));
$sFrmEntriesRecevied = $aDataRecevied->sData->aFrmEntries;
and then i find my custom WP post, and save add/update it to the post with:
update_post_meta($iPost_ID, "aFrmEntries", json_encode($aFrmEntries), "");
The DB is runing: InnoDB & utf8mb4_unicode_ci, but that im very confident that wouldnt be a problem(?)
i'm not really sure what is wrong with this, but i hope somebody had an idea
the string the plugin gets from the endpoint looks like:
{"64":"H\u00f8jb","65":"Hansen","66":"asd@hotmail.com","date_created":"2016-11-21 13:11:26","form_id":"6"}
edit
Apparently the \ is removed by WP when i save the data to the DB