0

I'm using Google map API to add markers and add information to them but the problem is with the Arabic characters it's displayed like strange symbols though page encoding is utf-8

enter image description here

var locations = [
  ['<div class="content" style="dir:rtl; text-align:right;">'+
  '<div id="siteNotice">'+
  '</div>'+
  '<h1 id="firstHeading" class="firstHeading"><?= "المنزل الأول" ?></h1>'+
  '<div id="bodyContent">'+
  '<p>العنوان بالتفصيل, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
  'https://en.wikipedia.org/w/index.php?title=Uluru</a> '+
  '(last visited June 22, 2009).</p>'+
  '</div>'+
  '</div>', -33.890542, 151.274856, 4],
  ['<div class="content" style="dir:rtl; text-align:right;">'+
  '<div id="siteNotice">'+
  '</div>'+
  '<h1 id="firstHeading" class="firstHeading">المنزل الثاني</h1>'+
  '<div id="bodyContent">'+
  '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
  'https://en.wikipedia.org/w/index.php?title=Uluru</a> '+
  '(last visited June 22, 2009).</p>'+
  '</div>'+
  '</div>', -33.923036, 151.259052, 5]
];
PHP User
  • 2,350
  • 6
  • 46
  • 87
  • possible duplicate: [How do I convert special UTF-8 chars to their iso-8859-1 equivalent using javascript?](http://stackoverflow.com/questions/5396560/how-do-i-convert-special-utf-8-chars-to-their-iso-8859-1-equivalent-using-javasc) – geocodezip Jun 06 '15 at 15:35
  • encode either the document(when it's a inline-script) or the script(when it's external) in UTF-8 – Dr.Molle Jun 06 '15 at 15:44

1 Answers1

1

The problem was with notepad++ encoding changed from ANSI to UTF-8 and every thing worked fine

PHP User
  • 2,350
  • 6
  • 46
  • 87