How to Work with Different Encodings in CAPL
If you create a new CAPL file in CANoe, the default Windows code page/encoding of the local PC's operating system is used. The code page represents the set of available characters which usually contains the seven-bit ASCII characters plus additional characters.
The numeric representation of it is automatically written into the first line of the CAPL file when it is created. In the example below encoding CP1252/Windows-1252 is used which corresponds to Western European):
This line does only tell the compiler which encoding is used in the CAPL file. Changing it to another encoding here, e.g. to. /*@!Encoding:65001*/ for UTF-8 does not convert the CAPL file into the new format.
If you want to work with UTF-8, you have to open the file in an external text editor (e.g. Notepad++) and save/convert the file to UTF-8 first.
Afterwards open the file with the CAPL editor and change the first line to
After saving it, the compiler recognizes/handles the file as UTF-8 formatted file.
It is also possible to “limit” the set of available characters to ASCII by using the following encoding: