我已經發布了一個Windows Phone應用程序。此後,BugSense報道,導致一些事故在國外的一個問題:外來文化XML文本解析
System.ArgumentException - 字符「I」(0x0130)不可用 在此SpriteFont類。如果適用,請調整字體的開始和結束字符區域以包含此字符。參數名:字符
,這裏是堆棧跟蹤:
在 Microsoft.Xna.Framework.Graphics.SpriteFont.GetIndexForCharacter(CHAR 字符)在 Microsoft.Xna.Framework.Graphics .SpriteFont.InternalMeasure(StringProxy & 文本)在 Microsoft.Xna.Framework.Graphics.SpriteFont.MeasureString(字符串文本) 在GlobalEngine.Visual.TextBase.CalculateSpriteOrigin(對象發件人, EventArgs e)上Sys系統在GlobalEngine.Visual.TextBase.set_FormattedText(字符串值) GlobalEngine.Visual.TextLabel.set_Text(String value) FourWordsLibrary.GameUtils.Letter..ctor(Char信,assetManager assetManager,spriteBatch spriteBatch,一寬度)在 FourWordsLibrary.GameUtils.Word..ctor(字符串orderedWord,字符串 shuffledWord,assetManager assetManager,spriteBatch spriteBatch, 輸入管理輸入管理,單letterWidth)在 FourWordsLibrary.GameUtils.Word ..ctor(String orderedWord,String shuffledWord,AssetManager assetManager,SpriteBatch spriteBatch, InputManager inputManager)at FourWords Library.Controllers.GameControl.StatePlay.SetupNextLevel()處 FourWordsLibrary.Controllers.GameControl.SetPack FourWordsLibrary.Controllers.GameControl.StatePlay.Activate(對象 OBJ)在GlobalEngine.Base.StateManager
1.SetState(T state, Object obj) at GlobalEngine.Base.StateManager
1.SetState(T狀態) (PackManager packManager)在FourWords.Screens.GameScreen..ctor(發動機引擎, obj對象)
我的應用程序是一個文字遊戲,我檢索字從一個XML文件中的每個級別。所以我懷疑當XmlReader正在讀取文件時,它會使用一種外來文化來實現,這種文化會導致一個拉丁字母被檢索出來,然後當它試圖使用嚴格的英文精靈字體繪製字母時,應用程序崩潰。 我試過尋找一種方法來指示XmlReader使用InvariantCulture來讀取,與在.toString()方法中找到的類似,但沒有找到任何。任何想法如何解決這個問題?
我有類似的問題,你有沒有想過如何解決它? – Orujimaru