4

I'm trying to display the proper name of cities with special characters in spanish such as 'tilde' Á, however I'm getting false encoding in the popup layers as you can see in the image:

leaflet popup wrong encoding UTF-8 I have my html charset defined as <meta charset="utf-8" /> and the .geojson is also alright:

{"type":"Feature","geometry":{
"type":"Point","coordinates":[-74.1059716,4.650528403]},
"properties":{
"DPTO_CCDGO":11.000000,
"MPIO_CCDGO":1.000000,
"CPOB_CNMBR":"BOGOTÁ D.C.",
"CPOB_NANO":2011.000000,
(...)

Any idea on how to fix it? I already checked with Chrome 58 and Firefox 53 with same result.

1 Answer 1

2

I had a similar problem, then I saw that my geojson wasn't encoded in UTF-8. Converting the geojson's encoding to UTF-8 fixed the issue for me.

1
  • 1
    Thanks for the solution. I changed the File Encoding easily with 'Sublime Text'. It was just File > Save with Encoding > UTF-8 and that's it.
    – Camilo
    Commented Jun 12, 2017 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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