3

I have data in GeoJSON that contains Arabic in some attribute when reading the attribute

info.push(features[i].get('Name'));

I get this:

enter image description here Unreadable how to enable UTF8 or I don't know...

  • In openlayers GIS – Rabie Ben Sep 19 '15 at 14:28
4

I was getting data from GeoJSON file ,and it was a problem of encoding characters in it at first place. I specified "utf-8" in the creation of my GeoJSON file ,and it worked well, thank you. enter image description here

3

OpenLayers 2 does not have any problems with arabic characters, see e.g. this fiddle.

However, you will need to specify the correct character encoding in your HTML file, something like:

<html>
<head>
    <meta charset="utf-8">
    ...
<head>
<body>
    ...
</body>
</html>

Also make sure your files are indeed in UTF-8 encoding, of course.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.