Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

ModelicaML file encoding issue?

ModelicaML file encoding issue?

after installing OpenModelica 1.8.1 r11643 the compiler suddenly started refusing to load the code generated by ModelicaML (i am using 1.8.8). the model execution report contains
<error_report>
Simulation failed for:
                  - MModel.Design.Test

************************** LOG ************************
checkModel: "Unknown model in checkModel: MModel.Design.Test
"

ErrorString: ""
</error_report>

the problem seems to be that the files generated by my ModelicaML are in "Cp1252" encoding (can that be changed through eclipse's configuration interface?) and the omc has recently been modified to enforce the Modelica specification that files must be UTF-8.

my workaround solution is to create a file <eclipse_project_root>\<model_name>\code-gen\package.encoding by hand, which simply contains the text "Cp1252".

i noticed that the latest nightly build of OpenModelica now only issues warnings if the encoding is wrong. however, i believe in the long run ModelicaML should implement a solution, whether that involves generating a package.encoding file, or perhaps by forcing the encoding to be UTF-8.

Edited by: adriaanph - Apr-17-12 14:20:40

Re: ModelicaML file encoding issue?

Hi,

thanks for pointing this out.
Have you tried to adjust  your Eclipse Preferenes (Window->Preferences->General->Workspace->Text file encoding -> UTF-8)?

Wladimir

Re: ModelicaML file encoding issue?

yes, and that does not seem to have any effect on the files generated by ModelicaML.

Re: ModelicaML file encoding issue?

Ok, I see. We will adress this issue soon when migrating to the new Acceleo framework for Modelica code generation.

In the mean time I implemented the generation of package.encoding file for the top-level package.mo (following your suggestion).
The update wil be available tomorrow.

Wladimir

There are 0 guests and 0 other users also viewing this topic
You are here: