Sometimes UTF symbols in the source files get corrupted
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Workcraft |
Fix Committed
|
High
|
Danil Sokolov |
Bug Description
Special symbols inserted in the source code, e.g. strings with Greek letters or arrows, are sometimes corrupted after branch merge. This is most likely due to some of the developers having non-UTF encoding in their editors.
A safer option is to avoid inserting UTF symbols directly in the source code and use hexadecimal values to represent these symbols instead, e.g.:
// Infinity symbol in UTF-8 encoding
public static final char INFINITY_SYMBOL = 0x221E;
// Right arrow symbol in UTF-8 encoding
public static final char RIGHT_ARROW_SYMBOL = 0x2192;
// Epsilon symbol in UTF-8 encoding
public static final char EPSILON_SYMBOL = 0x03B5;
When needed, these characters can be converted to string using Character.toString method.
Related branches
- Danil Sokolov: Approve
-
Diff: 269 lines (+108/-10)8 files modifiedCircuitPlugin/src/org/workcraft/plugins/circuit/tools/CircuitSimulationTool.java (+85/-1)
DfsPlugin/src/org/workcraft/plugins/dfs/tools/Cycle.java (+4/-1)
DfsPlugin/src/org/workcraft/plugins/dfs/tools/CycleAnaliserTool.java (+7/-2)
FsmPlugin/src/org/workcraft/plugins/fsm/VisualEvent.java (+4/-1)
FsmPlugin/src/org/workcraft/plugins/fsm/tools/FsmSimulationTool.java (+4/-1)
WorkcraftCore/src/org/workcraft/Info.java (+2/-2)
build_distr_linux.sh (+1/-1)
build_distr_windows.sh (+1/-1)