Opened 12 years ago

Closed 6 years ago

#1883 closed defect (fixed)

OMEdit has issues when opening files with special chars in them ...

Reported by: Adrian Pop Owned by: Adrian Pop
Priority: high Milestone: 1.14.0
Component: OMEdit Version: trunk
Keywords: Cc: Adeel Asghar, Martin Sjölund

Description

The file in c:/tö/ö/ägg/åter/file.mo will not be
open and no error message will be given by OMEdit.

It might be an omc issue and not an OMEdit issue.

Change History (18)

comment:1 by Adrian Pop, 12 years ago

Cc: Martin Sjölund added

Ok, this seems to be an issue with omc.

adrpo@ida-liu050 ~/dev/OMTesting
$ ~/dev/OpenModelica/build/bin/omc +locale=C martin\366/Aufgabe1b.mo 
Error processing file: martinö/Aufgabe1b.mo
Error: iconv("martinö/Aufgabe1b.mo",to="UTF-8",from="UTF-8") failed: Illegal byte sequence

# Error encountered! Exiting...
# Please check the error message and the flags.

Execution failed!

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

Uhmmm... You are sending an ISO-8859-1 ö... It works fine in a UTF-8 terminal:

$ omc +locale=C martinö/abc.mo 
/home/marsj/dev/trunk/build/bin/omc 1.9.0 Beta1 (r13118)
class M
end M;

If you have a non-UTF8 filesystem you need to add character conversion calls for this! I will add a check to verify that all flags sent to the compiler are in UTF-8.

Last edited 12 years ago by Martin Sjölund (previous) (diff)

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

No more omc issue :D

comment:4 by Adeel Asghar, 12 years ago

No, its still an omc issue but maybe only on Windows. Its better to fix it in omc rather than handling it in all clients since its the loadFile command that's failing.

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

I believe it's not loadFile, but rather parsing the input string. Like this session in OMShell-terminal:

>>> "åäö"
"åäö"
>>> getErrorString()
""
# Changing terminal encoding to ISO-8859-1 here.
>>> "åäö"
Error occured building AST
Syntax Error
[<interactive>:1:0-1:3:writable] Error: The file was not encoded in UTF-8:
  "???".
  To change encoding when loading a file: loadFile(encoding="ISO-XXXX-YY").
  To change it in a package: add a file package.encoding at the top-level.
  Note: The Modelica Language Specification only allows files encoded in UTF-8.

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

Owner: changed from somebody to Adeel Asghar
Status: newassigned

So you need to change it to send a UTF-8 string in clients. Come on, everything is UTF-8 :) After that, we can look into making it convert filenames to Windows encoding when on Windows.

comment:7 by Martin Sjölund, 11 years ago

Milestone: 1.9.01.9.1

Postponed until 1.9.1

comment:8 by Martin Sjölund, 10 years ago

Milestone: 1.9.11.9.2

This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).

comment:9 by Adrian Pop, 10 years ago

Owner: changed from Adeel Asghar to Adrian Pop
Status: assignedaccepted

This is ugly but we need to use the wide char API in Windows (which supports UTF16).

comment:10 by Martin Sjölund, 10 years ago

Milestone: 1.9.21.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

comment:11 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

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

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

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

Milestone: 1.9.51.10.0

Milestone renamed

comment:14 by Martin Sjölund, 8 years ago

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

comment:15 by Martin Sjölund, 8 years ago

Milestone: 1.11.01.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:16 by Adeel Asghar, 7 years ago

Milestone: 1.12.01.13.0

comment:17 by Francesco Casella, 6 years ago

Milestone: 1.13.01.14.0

Rescheduled to 1.14.0 after 1.13.0 releasee

comment:18 by Adeel Asghar, 6 years ago

Resolution: fixed
Status: acceptedclosed

This has been fixed in some recent commits.

Note: See TracTickets for help on using tickets.