Opened 13 years ago

Last modified 13 years ago

#1683 closed defect (fixed)

Accented letters in the comments end up in the Model_init.xml and make it not well formed.

Reported by: adrpo Owned by: adrpo
Priority: high Milestone:
Component: Version:
Keywords: Cc: adrpo, adeas31, adrpo, sjoelund.se

Description

Thanks a lot to Francesco for finding this bug.

model Test
 Real x "densità fluido";
equation
 der(x) = -1 * x;
end Test;

Attachments (1)

a.onb (1.2 KB) - added by sjoelund.se 13 years ago.
Notebook to test with

Download all attachments as: .zip

Change History (13)

comment:1 Changed 13 years ago by adrpo

This model was in OMNotebook, maybe that's the problem.

comment:2 Changed 13 years ago by sjoelund.se

WORKSFORME
{{{loadString(iconv(readFile("a.mo"),from="ISO-8859-1"));
simulate(Test);getErrorString();}}}

Or simply loadFile if it is already UTF-8

comment:3 Changed 13 years ago by adrpo

You should try it as a cell in OMNotebook.

comment:4 Changed 13 years ago by sjoelund.se

Wow, OMNotebook is stupid.

The .onb is stored as UTF-8. My locale setting is UTF-8. Yet it converts the text to ISO-8859-1 for the input cell? *cries*

comment:5 Changed 13 years ago by sjoelund.se

OMNotebook will handle the following properly:
{{{model Test

Real x "densità fluido ??????";

equation

der(x) = -1 * x;

end Test;}}}

EDIT: (CodeBeamer doesn't like Japanese characters and makes them ?????)

Stored in the .onb and displayed by the GUI. Works fine. But sending it over CORBA converts it to ISO-8859-1...

{{{model Test

Real x "densit<E0> fluido ??????";

equation

der(x) = -1 * x;

end Test;}}}

comment:6 Changed 13 years ago by adrpo

Maybe there is a setting in omniorb/mico or we might need to recompile it with some other flags?

comment:7 Changed 13 years ago by adrpo

http://omniorb.sourceforge.net/omni41/omniORB/omniORB004.html

nativeCharCodeSet    default = ISO-8859-1
The native code set the application is using for char and string. See chapter 9.

comment:8 Changed 13 years ago by adeas31

Is this the flag for server or client or both?

comment:9 Changed 13 years ago by adrpo

Good question. I think you should set it for the client and see what happens.
If is not working I can look more at the mico corba settings in OMC.

comment:10 Changed 13 years ago by sjoelund.se

No, it's much simpler. Simply pass the damn unicode string to OMC. Server and client uses 8859-1 encoding so it will be passed verbatim. I know I fixed the same thing for OMEdit before (it was also silly, converting .toLatin1() before sending the expression). The example is now working.

comment:11 Changed 13 years ago by adeas31

It doesn't works for me. Also OMEdit uses toLocal8Bit().

Changed 13 years ago by sjoelund.se

Notebook to test with

comment:12 Changed 13 years ago by sjoelund.se

I attached the notebook I tested. It does work properly. Also, toLocal8Bit is the same as UTF8 for me ;)

Note: See TracTickets for help on using tickets.