【问题标题】:Vici coolstorage text fields not showing properly in WP7 app (some characters missing)Vici Coolstorage 文本字段在 WP7 应用程序中未正确显示(缺少某些字符)
【发布时间】:2012-02-05 20:51:34
【问题描述】:

我有一个 sqlite 数据库,我使用 coolstorage ORM 从我的 WP7 应用程序访问它。用于 db 文本字段的字符集(德语)是 UTF-8。数据库非常简单,只有一张表。我在应用中的模型如下所示:

[MapTo("recipes")]
public class Recipe : CSObject<Recipe,int>
{
    [DefaultSort]
    public int Id
    {
        get { return (int)GetField("Id");  }
    }

    public string Category
    {
        get { return (string)GetField("Category"); }
        set { SetField("Category", value); }
    }

    // More text fields

然后我通过执行以下操作从数据库中获取一行:

rec = Recipe.ReadFirst("Category=@Category and Name=@Name",
                                 "@Category", category,
                                 "@Name", recipe);

问题是所有特殊的德语字符都像这样显示:�,即使它们已正确存储在数据库中。所有正常的 ASCII 字符都显示得很好。

我该如何解决这个问题?提前致谢。

【问题讨论】:

  • “出现”是什么意思?你如何显示文本?在 HTML 中?
  • @PhilippeLeybaert 嘿,感谢您的回复。我只是将我获取的字符串数据绑定到我的视图上的文本块中。如果有任何帮助,我正在使用 MVVM 灯。所以在我看来,我有这样的东西:

标签: c# windows-phone-7 character-encoding coolstorage


【解决方案1】:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-14
    • 1970-01-01
    • 2020-04-07
    • 1970-01-01
    相关资源
    最近更新 更多