2016-02-01 41 views
2

對於UWP應用程序使用Template10會產生問題。如果我想在設計時顯示特殊字符,一切似乎都可以。在運行時,特殊字符將無法正確顯示,正如您在截圖中看到的一樣。使用Template10時,運行時不能正確顯示特殊字符(如Ü,Ä,Ö)

<!-- page header --> 
    <controls:PageHeader Content="Übersicht"> 
     <controls:PageHeader.SecondaryCommands> 
      <AppBarButton Click="{x:Bind ViewModel.GotoSettings}" Label="Settings" /> 
      <AppBarButton Click="{x:Bind ViewModel.GotoPrivacy}" Label="Privacy" /> 
      <AppBarButton Click="{x:Bind ViewModel.GotoAbout}" Label="About" /> 
     </controls:PageHeader.SecondaryCommands> 
    </controls:PageHeader> 

例如 「Ü bersicht」 - >的VisualStudio設計師 「Ü bersicht」 - 「?bersicht」>運行

設計器視圖

enter image description here

運行時間

enter image description here

+0

爲了將來的參考,請試試這個:http://stackoverflow.com/a/10186640/6496980。它爲我工作。 –

回答

1

如果使用字符串資源(.resw文件),人物也將出現正確:

XAML:X:UID = 「...」

C#:ResourceLoader.GetForViewIndependentUse()的GetString(」 ...「);

+1

使用字符串資源可解決問題。感謝您的帖子Luis。但我不明白爲什麼這只是如果我使用template10。在默認的Visual Studio uwp模板的情況下,我不必使用字符串資源和特殊字符將正確顯示。 – WHITESEVEN

1

你有沒有設置你的PrimaryLanguageOverride

你處理UTF-8在默認情況下,所以我通常會希望它是好的,但在這種情況下,如果你不希望設置你的本地化可以替代unicode&#220;可靠地顯示Ü

+0

感謝您的回答克里斯。我正在尋找這個覆蓋(也是模板10項目)的解決方案,並不能找到這個方法調用。 – WHITESEVEN

相關問題