View Issue Details

IDProjectCategoryView StatusLast Update
0009921Dwarf FortressCreaturespublic2016-08-08 15:04
ReporterDirst Assigned Tolethosor  
PrioritylowSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
PlatformWindowsOSWindowsOS Version7
Product Version0.43.05 
Summary0009921: Creature tiles specified by quoted text displayed incorrectly
DescriptionMantis doesn't like special characters, so I will use names rather than glyphs.

If a creature's tile is specified by [CREATURE_TILE:'a'] but using any accented letter then it actually appears as character 195 in the loading screen and on the map. Using a numeric code to define the tile works as expected.

The problem is consistent when the raw file is encoded at UTF-8. Converting it to what Notepad++ calls "OEM-US" reveals that the string is actually stored as two bytes 195 and 162.
Steps To ReproduceUse Notepad++ to mod a creature with [CREATURE_TILE:'a'] but with any accented letter, and spawn it in the arena.
Additional InformationIt's not worth the effort to cram a Unicode parser into the raw parser, but the game could emit something to the error log when a tile string has more than one byte in it.

MODDED_CREATURE:Multibyte or Unicode string for creature tile
Tagsraw file

Activities

lethosor

2016-07-23 10:54

manager   ~0035693

Last edited: 2016-07-23 10:55

From what I remember, the raw files are (or used to be) CP437-encoded. Can you try saving with that encoding instead and see if it works?

Edit: "latin1" might be equivalent for accented letters, if you don't have a CP437 option.

Dirst

2016-07-24 14:07

reporter   ~0035701

Last edited: 2016-07-24 14:08

I realized it was an encoding problem when I tried to use a different accented character and got the same creature tile, so it's entirely on my end but I think it's an easy mistake to make.

The choices available in one of the more popular text editors for modding:

http://i8.photobucket.com/albums/a28/8gon/Notepadd.png

You have to pick "OEM-US" to get it to encode properly, which is not a default or obvious. I think an error message in DF's log would suffice to put most modders on the right track.

lethosor

2016-07-28 19:07

manager   ~0035720

I'm having a hard time coming up with a way to tell whether a file mistakenly contains UTF-8 characters or multiple CP437 ones, but I agree that some kind of warning would be more helpful.

Dirst

2016-08-08 15:04

reporter   ~0035769

That was why I thought it should warn about "Multibyte or Unicode string" where one character is expected (creature tile, workshop tile, plant growth, etc.).

Add Note

Note

Issue History

Date Modified Username Field Change
2016-07-15 12:21 Dirst New Issue
2016-07-15 12:25 Dirst Tag Attached: raw file
2016-07-23 10:54 lethosor Note Added: 0035693
2016-07-23 10:54 lethosor Assigned To => lethosor
2016-07-23 10:54 lethosor Status new => feedback
2016-07-23 10:55 lethosor Note Edited: 0035693
2016-07-24 14:07 Dirst Note Added: 0035701
2016-07-24 14:07 Dirst Status feedback => assigned
2016-07-24 14:08 Dirst Note Edited: 0035701
2016-07-28 19:07 lethosor Note Added: 0035720
2016-07-28 19:07 lethosor Status assigned => acknowledged
2016-08-08 15:04 Dirst Note Added: 0035769