Malloc
Malloc

Reputation: 16276

How to display words with accent

when i try to encode a word with accent like Sous-Préfecture like this:

$libelle=utf8_encode('Sous-Préfecture');
echo json_encode($libelle);

i got:

Sous-Pr\u00e9fecture

Is there any way to show the accent in that kind of words?

Upvotes: 0

Views: 129

Answers (1)

dkulkarni
dkulkarni

Reputation: 2830

Use

echo json_encode(utf8_decode($libelle));

Upvotes: 1

Related Questions