encoding not latin characters google map marker information

点点圈 提交于 2020-02-08 07:02:45

问题


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

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:


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



来源:https://stackoverflow.com/questions/30684471/encoding-not-latin-characters-google-map-marker-information

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!