# Game crashes if hit log contains accented characters

**URL:** https://discourse.cataclysmdda.org/t/game-crashes-if-hit-log-contains-accented-characters/12510
**Category:** The Garage
**Created:** [September 10, 2016, 12:59pm UTC](https://discourse.cataclysmdda.org/t/game-crashes-if-hit-log-contains-accented-characters/12510 "2016-09-10T12:59:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dunee](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@dunee](https://discourse.cataclysmdda.org/u/dunee)
#### Post date: [September 10, 2016, 12:59pm UTC](https://discourse.cataclysmdda.org/t/game-crashes-if-hit-log-contains-accented-characters/12510/1 "2016-09-10T12:59:48Z")

</div>

So I’m working on the Hungarian localization and have hit a game breaking bug.

 ![](http://i.imgur.com/ilXDMzj.png)

Up until a few days ago, if the hit log notification contained an accented character, it just displayed some garbage character, as seen above. Since a few days ago, the game straight out crashes.

However, this only happens when a ranged weapon hits. I’m still getting garbage characters with melee hits, but the game does not crash.

Is it possible to replace the terminal font used to display these messages with a Unicode font as well? I’m already using Cousine-Bold.ttf as a replacement font for the other typeface.

I’m using the latest experimental, build 5463, Windows x86 tiles (0.C-18110-g368db5e). If I change Cata’s language settings to English I do not get a crash.

The MO I’m using is at [https://dl.dropboxusercontent.com/u/140157/cataclysm-dda.mo](https://dl.dropboxusercontent.com/u/140157/cataclysm-dda.mo)

Thanks!

---

<div class="post-metadata">

### Author: ![dunee](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@dunee](https://discourse.cataclysmdda.org/u/dunee)
#### Post date: [February 15, 2017, 8:44pm UTC](https://discourse.cataclysmdda.org/t/game-crashes-if-hit-log-contains-accented-characters/12510/2 "2017-02-15T20:44:37Z")

</div>

Resurrecting this old threat, because zombies and also because I still can’t figure out what’s wrong.

So I’m still getting a crash, currently on a fresh install of build 6228 on Windows (0.c-21120-g65e976fea). The crash is with the Hungarian MO that I’ve converted from a partly translated English PO, itself obtained from the CDDA github. The translated PO is also available on request. Converting from the PO to the MO using msgfmt yields the following messages, but looking at the PO I see nothing out of place:

`
dunee@DUNEE-WIN10:/mnt/c/Users/Dunee/Desktop/hu-HU$ msgfmt cataclysm-dda.po -o cataclysm-dda.mo
cataclysm-dda.po:94806: 'msgid' and 'msgstr' entries do not both end with '\n'
cataclysm-dda.po:96626: 'msgid' and 'msgstr' entries do not both begin with '\n'
cataclysm-dda.po:96654: 'msgid' and 'msgstr' entries do not both begin with '\n'
cataclysm-dda.po:96679: 'msgid' and 'msgstr' entries do not both begin with '\n'
cataclysm-dda.po:96702: 'msgid' and 'msgstr' entries do not both begin with '\n'
cataclysm-dda.po:96735: 'msgid' and 'msgstr' entries do not both begin with '\n'
cataclysm-dda.po:96787: 'msgid' and 'msgstr' entries do not both end with '\n'
cataclysm-dda.po:96829: 'msgid' and 'msgstr' entries do not both end with '\n'
cataclysm-dda.po:96871: 'msgid' and 'msgstr' entries do not both end with '\n'
cataclysm-dda.po:96911: 'msgid' and 'msgstr' entries do not both end with '\n'
cataclysm-dda.po:96969: 'msgid' and 'msgstr' entries do not both begin with '\n'
cataclysm-dda.po:118251: 'msgid' and 'msgstr' entries do not both begin with '\n'
cataclysm-dda.po:125672: 'msgid' and 'msgstr' entries do not both end with '\n'
msgfmt: found 16 fatal errors`

To reproduce the crash, use the MO from [https://dl.dropboxusercontent.com/u/140157/cataclysm-dda.mo](https://dl.dropboxusercontent.com/u/140157/cataclysm-dda.mo), copy it to lang\mo\fr\LC\_MESSAGES, start the game, set language to French and restart the game. Spawn any ranged weapon and hit any creature nearby. The game crashes. Other than that, the Hungarian text shows up fine, especially with the new Unicode font.

I don’t even know where to start looking, debug.log has nothing. Its last line is: `21:24:36.22 INFO : Added requirement: inline_vehins_base_xlhalfboard_vertical`

I have figured out since my initial post that the garbage characters have nothing to do with the crash. First, I’ve replaced all hit related text with non-accented characters. Second, the garbage characters still show up fine on a melee attack, so the issue is presumably related to some string being called when ranged weapons are fired.

I’m at a complete loss, please help!

---

<div class="post-metadata">

### Author: ![dunee](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@dunee](https://discourse.cataclysmdda.org/u/dunee)
#### Post date: [May 16, 2017, 8:21pm UTC](https://discourse.cataclysmdda.org/t/game-crashes-if-hit-log-contains-accented-characters/12510/3 "2017-05-16T20:21:49Z")

</div>

Necroing the post again, as I’ve finally figured out what went wrong.

 ![](http://i.imgur.com/vXRR5Gi.png)

Apparently a long while ago I’ve changed the word order, so instead of “You hit the %s for %d” the Hungarian localization went “For %d damage you hit the %s” (more logical word order).

So that crashed to the desktop on Windows and even caused a segfault on my Ubuntu machine. Had to learn how to debug a segfault, but found it! Changed the word order back as it should be and killed my first bug (that I’ve caused in the first place).

Nothing to do with accented characters, in the end. The game displays a different string when you hit someone with a ranged weapon, something else when you melee. The errors thrown by gettext conversion don’t seem to be relevant either.

In conclusion, if you’re working on a localization, don’t assume that changing the order of variables in a string is an bulletproof thing to do.
