For problems with "setlocal", check with this line the correctly local-expression (e.g. after the setlocal-line):
echo system('locale -a');So you can see how the local must be written.
In my case "de_DE" was wrong, it must be "de_DE.utf8"
Hope it helps ...