Opened 10 years ago
Closed 10 years ago
#3033 closed defect (fixed)
OMEdit does not seem to treat UTF-8 in its Text View
Reported by: | rfranke | Owned by: | adeas31 |
---|---|---|---|
Priority: | high | Milestone: | 1.9.2 |
Component: | OMEdit | Version: | trunk |
Keywords: | Cc: |
Description (last modified by adeas31)
Localization of models requires doc strings with non-ASCII characters, like:
model Foo Real mu = 1e-6 "Does OpenModelica treat UTF-8, like µ or ö in Linköping?"; end Foo;
Encoded with UTF-8, OMEdit opens the model, but scrambles the non-ASCII characters in its Text View:
model Foo Real mu = 1e-6 "Does OpenModelica treat UTF-8, like µ or ö in Linköping?"; end Foo;
One can edit the model and save it. One must not introduce a new non-ASCII char though, because OMEdit will replace all of them with a question mark then?
It is possible to translate and simulate the model. The Variables Browser in the plot pane treats UTF-8 encoded doc strings correctly.
Is this a bug in the Text View of OMEdit?
Attachments (2)
Change History (12)
comment:1 Changed 10 years ago by adeas31
- Description modified (diff)
Changed 10 years ago by adeas31
comment:2 Changed 10 years ago by adeas31
Changed 10 years ago by rfranke
comment:3 Changed 10 years ago by rfranke
That's strange. I'm using the released 1.9.1 (r22929) under Windows 7. Just to be sure: can you please check the attached file?
comment:4 Changed 10 years ago by adeas31
Works fine.
comment:5 Changed 10 years ago by adeas31
What is your Windows locale? German? Because I saw this is main.cpp,
#ifndef WIN32 QTextCodec::setCodecForLocale(QTextCodec::codecForName(Helper::utf8.toLatin1().data())); #endif
comment:6 Changed 10 years ago by rfranke
I'm using Formats from US and Location Germany. Playing around with the locale (Swedish vs. US vs. German) didn't change anything in OMEdit. I verified the correct behavior in Ubuntu though!
comment:7 follow-up: ↓ 8 Changed 10 years ago by rfranke
Does the compiler directive above mean that the Windows version of OMEdit is missing something?
comment:8 in reply to: ↑ 7 Changed 10 years ago by adeas31
Replying to rfranke:
Does the compiler directive above mean that the Windows version of OMEdit is missing something?
Yes. But I guess it has nothing to do with this issue as my Windows 7 is displaying everything fine.
comment:9 Changed 10 years ago by rfranke
Just installed a fresh nightly (r23815) and the problem under Windows 7 disappeared!
comment:10 Changed 10 years ago by adeas31
- Resolution set to fixed
- Status changed from new to closed
That's strange. I looked into the svn logs and my guess is that r23122 might have fixed this issue. I don't see any other commit that is related to this issue.
I can't reproduce this with r23791.
I save your example model to a file and opened it. The text view looks as expected. See the attached screenshot.