From 4bc7d1b6d99d3b0ebd91b72c0a408edd0cc6d3f6 Mon Sep 17 00:00:00 2001 From: nkorslund Date: Tue, 22 Jul 2008 21:12:22 +0000 Subject: [PATCH] Workaround for utf problem in esmtool git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@33 ea6a568a-9f4f-0410-981a-c910a81bb256 --- esmtool.d | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/esmtool.d b/esmtool.d index 34f7b52b8..07c37089e 100644 --- a/esmtool.d +++ b/esmtool.d @@ -156,7 +156,8 @@ void main(char[][] args) case WT.Bolt: writef("Bolt"); break; default: assert(0); } - writefln(" id '%s': name '%s'", n, m.name); + try writefln(" id '%s': name '%s'", n, m.name); + catch {writefln("(Invalid UTF string)");} if(m.data.flags & Weapon.Flags.Magical) writefln("Magical"); @@ -225,14 +226,22 @@ void main(char[][] args) writefln("Total cell placable items: ", cellRefs.length); } if(scptList) foreach(a, b; scripts.names) writefln(a); - if(ciList) foreach(a, b; cells.in_cells) writefln(a); + if(ciList) + foreach(a, b; cells.in_cells) + { + try writefln(a); + catch {writefln("(Invalid UTF string)");} + } if(ceList) foreach(uint i, c; .cells.ex_cells) { int x, y; CellList.decompound(i, x, y); if(c.name.length) - writefln("%s,%s: %s", x, y, c.name); + { + try writefln("%s,%s: %s", x, y, c.name); + catch {writefln("(Invalid UTF string)");} + } } if(scptShow)