# Cannot save memorial file

**URL:** https://discourse.cataclysmdda.org/t/cannot-save-memorial-file/2907
**Category:** The Garage
**Created:** [September 2, 2013, 6:24am UTC](https://discourse.cataclysmdda.org/t/cannot-save-memorial-file/2907 "2013-09-02T06:24:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![xap](https://avatars.discourse-cdn.com/v4/letter/x/848f3c/32.png) [@xap](https://discourse.cataclysmdda.org/u/xap)
#### Post date: [September 2, 2013, 6:24am UTC](https://discourse.cataclysmdda.org/t/cannot-save-memorial-file/2907/1 "2013-09-02T06:24:30Z")

</div>

It’s happens when I using a translated .mo and a translated random player name.

debug message:  
game.cpp[2911]: Could not open memorial file ‘memorial/瑪德琳 強森-Mon Sep 02 13-25-33 2013.txt’

---

<div class="post-metadata">

### Author: ![Ian\_Strachan](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/ian_strachan/32/1003_2.png) [@Ian\_Strachan](https://discourse.cataclysmdda.org/u/Ian_Strachan)
#### Post date: [September 2, 2013, 6:27am UTC](https://discourse.cataclysmdda.org/t/cannot-save-memorial-file/2907/2 "2013-09-02T06:27:02Z")

</div>

I remember getting that message when I had a phantom linebreak in the filename. The OS doesn’t like those characters being in a filename. The save files get around this by base64-encoding the save file names, but that’s not as feasible for memorials as their names and contents are supposed to be human-readable.

Anyone with more knowledge of non-ASCII characters and filenames willing to chip in on this?

---

<div class="post-metadata">

### Author: ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)
#### Post date: [September 2, 2013, 3:15pm UTC](https://discourse.cataclysmdda.org/t/cannot-save-memorial-file/2907/3 "2013-09-02T15:15:40Z")

</div>

A quick look confirms my suspicion that this just isn’t handled properly in c++/stl, which is why we’re base64 encoding the character saves.  
AFAIK the only way around this is to build a blacklist or whitelist of characters, and mangle characters we don’t support.  
Aah, of course such a whiteslist exists, it looks like what we want to do is sanitize the string like (python pseudocode because reasons)

for character in name:  
if !isgraph(character):  
character = ‘\_’

Haven’t tested it, but that’s something like what we want.

---

<div class="post-metadata">

### Author: ![Ian\_Strachan](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/ian_strachan/32/1003_2.png) [@Ian\_Strachan](https://discourse.cataclysmdda.org/u/Ian_Strachan)
#### Post date: [October 21, 2013, 5:04pm UTC](https://discourse.cataclysmdda.org/t/cannot-save-memorial-file/2907/4 "2013-10-21T17:04:54Z")

</div>

Sorry to bump this thread, but I have a fix pending for this issue that I simply don’t know how to test.

PR: [https://github.com/CleverRaven/Cataclysm-DDA/pull/3600](https://github.com/CleverRaven/Cataclysm-DDA/pull/3600)

If an international user could please verify that this fixes the issue (or tell me how to input Chinese glyphs as a character name) I would appreciate it.
