On 14.09.21 00:34, Lex Trotman wrote:
It's Python and not generally on Windows but on my box. On my Windows box, Python detects de-DE with cp1252 charset as locale and rst2html (which is written in Python) then seems to read the UTF-8 encoded geany.txt with cp1252 and this fails, obviously.
I didn't find a way yet to change the locale used by Python, the usual LANG, LANGUAGE, LC_ALL and friends environment variables do not work. It seems Python uses some Windows API to get the locale. But it's mainly a local issue on my end, so no worries. I'll take care to pass "--input-encoding=utf-8" to rst2html when building the docs for the next release and after the release, I'm going to blow up my Windows box anyways.
Locales are an evil and dangerous thing from the past!!! Why should non-interactive programs run differently on different machines? [stop before I start ranting]
Ok, so its the Geany build makefile that needs to have the specification of input encoding added so it works everywhere and no risk of non-UTF-8 locales breaking it.
Not sure if it is necessary. The concrete problem with the wrongly encoded characters is rather a configuration problem on my system, I'd say. Anyway, generally enforcing UTF-8 on rst2html for geany.txt should be fine as we have full control over the file and it probably will stay UTF-8 encoded for the next 20 years.
Regards, Enrico