1

I have a code like below

header('Content-Type: text/plain; charset=UTF-8');
echo 'Welcome to Loréal Website';

When I try to print this content in browser it coming é in Loréal is deformed.

enter image description here

How to solve this issue ?

Thanks for Reply

Rikesh
  • 26,156
  • 14
  • 79
  • 87
ArrayOutOfBound
  • 2,614
  • 5
  • 20
  • 26

5 Answers5

0

Make sure that your source file is actually encoded in UTF-8.

Wookai
  • 20,883
  • 16
  • 73
  • 86
0

Check that your browser is configured with UTF-8 Encoding.

Usually under View-> Encoding -> UTF-8

Iraklis
  • 2,762
  • 1
  • 24
  • 31
0

Configure the editor you are using to write the PHP to save in UTF-8.

The problem is because you are claiming the data is UTF-8 when it isn't.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
0

Please be sure the php file you have created is in utf8 charset. Also check if utf8 encoding is supported/configured by your web server.

See this link in case you have apache https://stackoverflow.com/a/913885/1716962

Community
  • 1
  • 1
  • The default encoding emitted by a server doesn't matter when you are stating it explicitly in your code. – Quentin Feb 26 '13 at 11:08
0

You could also try:

echo htmlentities('Welcome to Loréal Website');
Christian Rapp
  • 1,853
  • 24
  • 37