c# - foreign culture XML text parsing -
i have released windows phone app while back. since then, bugsense reported problem causing crashes in foreign countries:
system.argumentexception - character 'İ' (0x0130) not available in spritefont. if applicable, adjust font's start , end characterregions include character. parameter name: character
and here stack trace:
at microsoft.xna.framework.graphics.spritefont.getindexforcharacter(char character) @ microsoft.xna.framework.graphics.spritefont.internalmeasure(stringproxy& text) @ microsoft.xna.framework.graphics.spritefont.measurestring(string text) @ globalengine.visual.textbase.calculatespriteorigin(object sender, eventargs e) @ system.eventhandler.invoke(object sender, eventargs e) @ globalengine.visual.textbase.set_formattedtext(string value) @ globalengine.visual.textlabel.set_text(string value) @ fourwordslibrary.gameutils.letter..ctor(char letter, assetmanager assetmanager, spritebatch spritebatch, single width) @ fourwordslibrary.gameutils.word..ctor(string orderedword, string shuffledword, assetmanager assetmanager, spritebatch spritebatch, inputmanager inputmanager, single letterwidth) @ fourwordslibrary.gameutils.word..ctor(string orderedword, string shuffledword, assetmanager assetmanager, spritebatch spritebatch, inputmanager inputmanager) @ fourwordslibrary.controllers.gamecontrol.stateplay.setupnextlevel() @ fourwordslibrary.controllers.gamecontrol.stateplay.activate(object obj) @ globalengine.base.statemanager
1.setstate(t state, object obj) @ globalengine.base.statemanager
1.setstate(t state) @ fourwordslibrary.controllers.gamecontrol.setpack(packmanager packmanager) @ fourwords.screens.gamescreen..ctor(engine engine, object obj)
my app word game, , retrieve words each level xml file. suspect xmlreader reading file, using foreign culture results in latin letter being retrieved, app crashes when tries draw letter using strictly english sprite-font. tried looking way instruct xmlreader read using invariantculture, similar found in .tostring() method, haven't found any. ideas how solve issue?
seems more input xml file problem me. check if contains 'invalid' character ('İ' (0x0130) ) , correct if necessary. if wrote input xml using app/game, check if writing contents using invariantculture well.
br,
Comments
Post a Comment