TransWikia.com

Missing special characters in Leaflet popup

Geographic Information Systems Asked by Camilo on January 5, 2021

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.

One Answer

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.

Correct answer by NettaB on January 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP