Anonymous | Login | 2022-08-10 09:04 UTC | ![]() |
My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0000222 | OMNeT++ | IDE / NED editor | public | 2010-12-10 07:44 | 2010-12-10 14:51 | ||||
Reporter | ViRe | ||||||||
Assigned To | andras | ||||||||
Priority | normal | Severity | text | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | 4.1 | ||||||||
Target Version | Fixed in Version | 4.2 | |||||||
Summary | 0000222: Chinese comments become gibberish in NED files. | ||||||||
Description | If I use the "Clean up NED files..." function, the Chinese comments in my NED files will become gibberish. //*********************************************************** // // This is my file header // package src; // // 中文注释(Chinese Comments) // simple TestSimple { } //*********************************************************** If I have a NED file like the upper one, and it is in the src folder. Now, I want to move the NED file into another folder, so the package will be wrong. I can use the "Clean up NED files..." function to correct the package. If I keep the NED Editor on, the Chinese comments still work right, but if I close the NED editor when clean the NED files, the Chinese comments will become gibberish, like the following //*********************************************************** // // ???????(Chinese Comments) // simple TestSimple { } //*********************************************************** In omnetpp4.1, the File header will be cleared too, but in 4.0, the File header will NOT be cleared. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
![]() |
|
(0000347) andras (administrator) 2010-12-10 14:50 |
The error occurs because CleanupNedFilesAction writes out the changed files in the platform default encoding, instead of the file's own encoding. The Java code uses newContent.getBytes() instead of newContent.getBytes(file.getCharset()). This causes a problem when NED files are in UTF-8, and the platform default encoding is some 8-bit format, e.g. ISO-8859-1 or Cp1252. Then newContent.getBytes() cannot represent the Chinese characters on 8 bits, and generates questions marks (?, x3F) instead. We'll this. Workaround for 4.1: set the platform default encoding to UTF-8. This page can help: http://stackoverflow.com/questions/361975/setting-the-default-java-character-encoding [^] |
(0000348) andras (administrator) 2010-12-10 14:51 |
Fixed. The bug also affected NED documentation generation; this was also fixed. |
![]() |
|||
Date Modified | Username | Field | Change |
2010-12-10 07:44 | ViRe | New Issue | |
2010-12-10 14:50 | andras | Note Added: 0000347 | |
2010-12-10 14:51 | andras | Note Added: 0000348 | |
2010-12-10 14:51 | andras | Status | new => resolved |
2010-12-10 14:51 | andras | Fixed in Version | => 4.2 |
2010-12-10 14:51 | andras | Resolution | open => fixed |
2010-12-10 14:51 | andras | Assigned To | => andras |
Copyright © 2000 - 2022 MantisBT Team |