Closed rmichaelis closed 9 years ago
Try to add ## -*- coding: utf-8 -*-
at the top of the file.
See http://docs.makotemplates.org/en/latest/unicode.html#specifying-the-encoding-of-a-template-file
I already tried, but unfortunately this has no effect.
Ok I think I've understood the problem.
This is due to this line : https://github.com/Geoportail-Luxembourg/geoportailv3/blob/master/CONST_Makefile#L513
this is generating something like that :
.build/venv/bin/mako-render --var "partials=geoportailv3/static/js/mymaps/mymaps.html" templatecache.mako.js > test.js
But the > test.js is not created as an UTF8 file and we try to push some utf8 content inside.
Now we have to find how to force the file to be created as utf8
It works now. I had to add the following line :
export PYTHONIOENCODING=UTF-8
here https://github.com/Geoportail-Luxembourg/geoportailv3/blob/master/CONST_Makefile#L513
Do you agree with this ???
Let me have a quick look.
Yes, that's the correct fix. This is what you want:
diff --git a/CONST_Makefile b/CONST_Makefile
index cfcd139..ab59ae2 100644
--- a/CONST_Makefile
+++ b/CONST_Makefile
@@ -510,7 +510,7 @@ $(OUTPUT_DIR)/build.css: $(LESS_FILES) .build/node_modules.timestamp
$(OUTPUT_DIR)/templatecache.js: templatecache.mako.js $(APP_PARTIALS_FILES)
mkdir -p $(dir $@)
- $(VENV_BIN)/mako-render --var "partials=$(APP_PARTIALS_FILES)" $< > $@
+ PYTHONIOENCODING=UTF-8 $(VENV_BIN)/mako-render --var "partials=$(APP_PARTIALS_FILES)" $< > $@
.build/externs/angular-1.4.js:
mkdir -p $(dir $@)
I'll backport this to c2cgeoportal.
Thank you
I try to use some accented letters but it seems that the mako renderer does not allow it. Example here : https://github.com/Geoportail-Luxembourg/geoportailv3/blob/renaud_test/geoportailv3/static/js/mymaps/mymaps.html#L3
The partial file is in UTF-8
Here is the compilation error :
Do you have an idea ?