encoding not latin characters google map marker in

2019-08-30 02:34发布

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]
];

1条回答
我命由我不由天
2楼-- · 2019-08-30 03:14

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

查看更多
登录 后发表回答