Picture of Lars Halkjær
Translation code page issue
by Lars Halkjær - Tuesday, 12 November 2019, 4:20 PM
 

I have a small problem with the Adapt translation grunt scripts.

They usually work without any problems, but today I suddenly had a course, where a few characters were wrong.

The problem stems from this line in "loadLanguageFile.js":

var detected = jschardet.detect(fileBuffer);

It detects the UTF-8 file as "Windows 1252" (with around 94% certainty...), probably because it contains only a few instances of one special Danish character.

I fixed it for now by forcing UTF-8 by out-commenting a few lines, but is there an official way I can force this in the future (we always use UTF-8 file for all text files).