View Issue Details

IDProjectCategoryView StatusLast Update
0003091FSSCPuser interfacepublic2014-08-11 07:57
ReporterYarn Assigned ToYarn  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx64OSWindows 7 
Product Version3.7.1 
Summary0003091: Accented letters treated as spaces during colorization [patch]
DescriptionDuring text colorization, FSO uses the is_a_word_separator() function in missionbriefcommon.cpp to determine when to stop colorizing a word. That function considers a word separator to be any char value that is 32 or less. This includes negative numbers. However, depending on the compiler, the char type can be (and usually is) signed by default, resulting in non-ASCII characters being treated as word separators during colorization. Because of this, if a word like "Gerüchte" is colorized the "retail" way, only the letters before the first non-Ascii characer (in this case, "Ger") is colorized; the rest is displayed as the default white.

The fix is simple: Modify is_a_word_separator() to explicitly specify 0 as the low end of the range that's considered a word separator. A patch that does just this is attached.
TagsNo tags attached.

Activities

Yarn

2014-08-11 03:31

developer  

mantis3091.patch (511 bytes)   
Index: code/mission/missionbriefcommon.cpp
===================================================================
--- code/mission/missionbriefcommon.cpp	(revision 10985)
+++ code/mission/missionbriefcommon.cpp	(working copy)
@@ -1425,7 +1425,7 @@
  */
 bool is_a_word_separator(char character)
 {
-	return character <= 32;					//  all control characters including space, newline, and tab
+	return ((character >= 0) && (character <= 32)); // all control characters including space, newline, and tab
 }
 
 /**
mantis3091.patch (511 bytes)   

MageKing17

2014-08-11 05:00

developer   ~0016201

Seems straightforward enough to me.

niffiwan

2014-08-11 07:57

developer   ~0016203

Fix committed to trunk@10986.

Related Changesets

fs2open: trunk r10986

2014-08-11 04:25

niffiwan


Ported: N/A

Details Diff
Fix mantis 3091 (from Yarn)

Treat non-ASCII chars above unsigned index 127 as word separators when
ending retail style colorisation
Affected Issues
0003091
mod - /trunk/fs2_open/code/mission/missionbriefcommon.cpp Diff File

Issue History

Date Modified Username Field Change
2014-08-11 03:31 Yarn New Issue
2014-08-11 03:31 Yarn Status new => assigned
2014-08-11 03:31 Yarn Assigned To => Yarn
2014-08-11 03:31 Yarn File Added: mantis3091.patch
2014-08-11 03:32 Yarn Status assigned => code review
2014-08-11 05:00 MageKing17 Note Added: 0016201
2014-08-11 07:57 niffiwan Changeset attached => fs2open trunk r10986
2014-08-11 07:57 niffiwan Note Added: 0016203
2014-08-11 07:57 niffiwan Status code review => resolved
2014-08-11 07:57 niffiwan Resolution open => fixed