德尔福2009 年,JvAppStorage 的 unicode 替代品
我正在寻找存储我的应用程序设置的最佳选项。我决定编写自己的类,该类继承自 TPercient,它将存储所有可用的配置选项。目前,我正在寻找保存它的最佳方法 - 我发现 JvAppStorage 看起来非常有前途(因为我无论如何都在我的项目中使用 JVCL...),但它不能正确处理 unicode (WideStrings)。对于 XML 文件,它将字符存储为实体,对于 ini 文件,它似乎存储正常,但在这两种情况下,加载字符串都会用大量问号替换文本...
是否有任何好的替代品可以处理 Unicode?
提前致谢。
I'm looking for the best option to store my application settings. I decided to write own class that inherits from TPersistent which would store all the config options available. Currently I'm looking for the best way to save it - and I found JvAppStorage which looked very promising (as I'm using JVCL in my project anyway...) but it doesn't handle unicode (WideStrings) properly. For XML files it stores chars as entities, for ini file it seems to be stored ok, but in both cases loading strings replaces the text with lots of question marks...
Is there any good replacement that handles Unicode as well?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
最近从 ini 文件(以及可怕的 xml!)转换为 JSON 用于设置存储。它是如此方便和灵活。请参阅超级对象。
Recently converted to JSON from ini files (and dreaded xml!) for setting storage. It's just so convenient and flexible. See SuperObject.
使用 UTF-8 作为 Unicode 数据在磁盘上的表示形式是很常见的。在您的代码中,使用
Utf8String
数据类型来保存以这种方式编码的数据,以便您记住在应用程序的其余部分中使用它之前需要对其进行转换。It's quite common use use UTF-8 as the on-disk representation of Unicode data. In your code, use the
Utf8String
data type to hold data encoded that way so you remember that you'll need to convert it before using it in the rest of your application.我使用 MSXML 将每个用户的设置存储在网络上的个人目录中。
它也应该处理 Unicode。
I use MSXML to store settings per user in a personal directory on the network.
It should handle Unicode as well.