Character set issue in sitemap file

I am running openhab 2.4.0 under Windows 10 and currently experimenting with my first openhab U.I. I am running intyo what is probably a very basic problem in getting my character sets handled correctly. I need to use French accented characters among other things and normally I have no issues with that in Windows 10.

However, when I use French characters in my default.sitemap file they are not rendered correctly: they rather come out as question marks. Actually, this is the case when I select the ANSI encoding when saving the sitemap. I also tried saving it as UTF8, but then the sitemap file gets rejected altogeter when the system starts.
Any help would be greatly appreciated.

Pierre

You should always use UTF-8. Openhab behaves very abnormal if you dont.
You´ll probably have to create a new UTF-8 file and not using converting.

Thanks for the suggestion.

Unfortunately, there appears to be something else going on. I tried to do as you suggested: create a UTF8 sitemap file from scratch. But when I restarted my openhab, the system once again rejected that file. In the log the followind message appears:

2019-03-27 17:33:40.061 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘default.sitemap’ has errors, therefore ignoring it: [1,1]: extraneous input ‘’ expecting ‘sitemap’

In order to verify that my sitemap file was indeed UTF8, I imported it as a text file into MS-Word with encoding set to UTF8. The file was imported and displayed correctly. Strangely enough, when the file is saved as ANSI, the file is accepted by openhab, though some characters are displayed incorrectly.

Please post your sitemap here in a fence box

Because you are hosting on Windows, the java system encoding may not be UTF-8 ? ISO-8859-1 perhaps?
I think you can force it to UTF-8 with an environment variable

@roosko57: Thanks for the tip. I am not sure if it matters whether or not one uses “UTF8” or “UTF-8”: I have seen both spellings when searching for java variables. But in any event I am still getting the same problem when I set the environment variable to either spelling.

At startup I am getting the relevant message on the console:

Launching the openHAB runtime... WARNING: Running Karaf on a Java HotSpot Client VM because server-mode is not available. Install Java Developer Kit to fix this. For more details see http://java.sun.com/products/hotspot/whitepaper.html#client Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

My sitemap is as follows:

sitemap default label="default" {
Switch item=lampe_perron label="Lampe du perron"
Switch item=lampes_garage label="Lampes du garage"
Switch item=lampes_ext_arriere label="Lampes ext arr."
Slider item=lampe_salon label="Lampe du salon"
Slider item=lampe_cuisine label="Lampe de la cuisine"
Switch item=Presence_mobile_Pierre label="Portable de Pierre présent"
Switch item=Presence_mobile_Evelyne label="Portable d'Evelyne présent"
    Switch item=motionSensor label="Détect. Mouvement 1"
Slider item=motionSensorBatteryLevel label="Détect. Mouvement 1"
    Text item=Thermo1 label="Bureau [%.1f °C]" icon="temperature"
Text item=Sunrise_Time
    Text item=Sunset_Time

}

Notice the accented characters and the temperature degree symbol".

And then I find the following lines in the openhab log:

2019-03-28 09:35:49.180 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '45.837516799999996,-72.5803008'. 2019-03-28 09:35:56.800 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.items' 2019-03-28 09:35:57.811 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007 2019-03-28 09:35:58.330 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.rules' 2019-03-28 09:35:58.471 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'default.sitemap' has errors, therefore ignoring it: [1,1]: extraneous input '' expecting 'sitemap'

2019-03-28 09:35:58.619 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘astro:sun:local’ to inbox.
2019-03-28 09:35:58.628 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘astro:moon:local’ to inbox.
2019-03-28 09:35:58.635 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘chromecast:chromecast:e1c8151feaf31d43b3811e6d91e1d027’ to inbox.
2019-03-28 09:35:58.857 [WARN ] [lipse.smarthome.io.net.exec.ExecUtil] - Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program “arping” (in directory “.”): CreateProcess error=2, The system cannot find the file specified)

However, if I ask notepad to save the file as ANSI, then the sitemap is loaded correctly but the accented characters are not displayed correctly.

It´s a big surprise that openhab seems to have problems with caracters inside the label of sitemaps… This should really not be an issue…
I didn´t know that things where different on windows. However I believe that somewhere in openhab, you should be able to define which caracters set to use. In openhabian it can be set up in openhabian-config. Unfortunaly I have no idea on windows.

Actually, I just realized that the problem only occurs with the items files: in my sitemap files, French character are indeed rendered correctly. And whether or not I define the variable JAVA_TOOLS_OPTIONS makes no difference in this case.

Thus I can make do with the current state of the system by making sure that I only use French charaters in the sitemap, though of course it would be desirable to find a way to fix the problem with the item files as well.