Which files are concerned by character encoding in Mosel?
Starting with version 4.0 Mosel is working in UTF-8. This concerns
- the internal representation of text
- all external APIs (i.e. all Mosel libraries)
- the communication with the system via Unicode (Windows) or system encoding (Posix)
All streams and text files default to UTF-8. There is no impact on applications that only use pure ASCII (first 127 characters), but text data files and source code using other encodings might require conversions or tagging. Note that no changes are required for other file types such as spreadsheets or databases.
Model source and text data files in Mosel format: Specify the encoding with the annotation !@encoding. For example if you are editing your model with an editor that employs the encoding CP1252:
!@encoding CP1252 model "my testmodel" ...
Other text/string input or output: Convert the encoding via the enc: prefix to file names and streams or by using the conversion routines of the XPRNLS library or command tool (see paragraph 'How can I convert the character encoding of a text file' below).