Laravel 5.2 when localize carbon date appear as question marks in blade

565 views Asked by At

I localized the date with carbon with this code

setlocale(LC_TIME, 'Arabic');

$dt = Carbon::now();

$date=$dt->formatLocalized('%A %d %B %Y');
echo $date;
dd("   " .$date);

I write this code in controller to test

  echo $date;

-view date correct appear as الأربعاء 21 ديسمبر 2016

-but when write this code data appear

dd("   " .$date); appear as ÇáÃÑÈÚÇÁ 21 ÏíÓãÈÑ 2016"

-and when write this code in blade or return blade after localize it appear as question marks.

-Date appear as �������� 21 ������ 2016

I don't understand where is the problem and how to solve it. please any one help me,

1

There are 1 answers

0
Zymawy On

Will I Think The Problem Is In Your Computer Check All Your Local Lang Via This Commend

locale -a

To Check If You Had The Lang Already Installed In Your PC

Then You Would Do Like

setlocale(LC_TIME, 'ar_SA.utf8');

If Doesn't Work You Can Use This Package Otherwise ,

Data Corbon