Search code examples
character-encodingwebserveropenlayersmouse-position

encoding problem when OpenLayers is loaded from web host


I'm working on a web based GIS using OpenLayers 7.1.0. When testing the code with VS-Code on my laptop (loading ol.js from local hard drive) everything is ok. Then I upload the project to a Linux web host (Plesk panel) including ol.js because I want it to work independent of OpenLayers CDN. Now, if ol.js is loaded from CDN, everything is OK. But if ol.js is loaded from the web host, characters showing the mouse pointer position are not shown correctly. screenshot is attached. In both cases, the same css file is loaded from my web host. what might be the problem ?

Screenshot attached

Is it possible that the web server on my Linux host changes something ?


Solution

  • The answer is from Mike:

    Adding meta charset="UTF-8" to your html should fix it, see stackoverflow.com/a/52016347/10118270