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: Adrian Pop Owned by: Adrian Pop
Priority: high Milestone:
Component: Version:
Keywords: Cc: Adrian Pop, Adeel Asghar, Adrian Pop, Martin Sjölund

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 Martin Sjölund 13 years ago.
Notebook to test with

Download all attachments as: .zip

Change History (13)

comment:1 by Adrian Pop, 13 years ago

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

comment:2 by Martin Sjölund, 13 years ago

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

Or simply loadFile if it is already UTF-8

comment:3 by Adrian Pop, 13 years ago

You should try it as a cell in OMNotebook.

comment:4 by Martin Sjölund, 13 years ago

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 by Martin Sjölund, 13 years ago

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 by Adrian Pop, 13 years ago

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

comment:7 by Adrian Pop, 13 years ago

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 by Adeel Asghar, 13 years ago

Is this the flag for server or client or both?

comment:9 by Adrian Pop, 13 years ago

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 by Martin Sjölund, 13 years ago

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 by Adeel Asghar, 13 years ago

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

by Martin Sjölund, 13 years ago

Attachment: a.onb added

Notebook to test with

comment:12 by Martin Sjölund, 13 years ago

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.