简体   繁体   English

将ASCII数据库模型转换为Unicode会很难吗?

[英]Would it be difficult to convert an ASCII database model to Unicode?

I'm planning on developing a Windows application (eventually expanding onto other platforms like mobile platforms) and have been doing research on the pros and cons of ASCII and Unicode data models for data storage. 我正在计划开发Windows应用程序(最终扩展到其他平台,例如移动平台),并且一直在研究用于数据存储的ASCII和Unicode数据模型的优缺点。 Initially, my application won't need to support any languages other than English, so that is one factor eliminated. 最初,我的应用程序不需要支持英语以外的任何语言,因此这是消除因素之一。

I am leaning towards using ASCII for my data model however, if I wanted to change this to Unicode in the future, would this be a very daunting task? 但是,我倾向于将ASCII用于我的数据模型,如果将来我想将其更改为Unicode,这将是一项非常艰巨的任务吗? I plan on using MS SQL Server for the database and developing on C#. 我计划将MS SQL Server用于数据库并在C#上进行开发。

My main concern is if I did choose to change data model types, my existing data at the time (well after application implementation) may possibly be modified or altered and won't be usable. 我主要担心的是,如果我确实选择更改数据模型类型,那么当时(在应用程序实施之后)我的现有数据可能会被修改或更改,将无法使用。

Thanks 谢谢

Rule of thumb 经验法则

For all user entered data ALWAYS use NVARCHAR(n), don't waste your time with bad design. 对于所有用户输入的数据, 始终使用NVARCHAR(n),不要因为设计不好而浪费时间。

In fact, unless you know for certain you don't need to store Unicode in certain fields, or you are trying to save bytes in a database to the nth degree, you are better off just using NVARCHAR(n) and save your self a lot of trouble in the future 实际上,除非您确定不需要将Unicode存储在某些字段中,或者您试图将字节保存到数据库的第n个度,否则最好只使用NVARCHAR(n)并保存自己的a。将来有很多麻烦

To answer you question directly 直接回答您的问题

its not that hard to recreate tables and copy across data, but why give your self the hassle when you can do it right and future proof now with no extra effort 重新创建表和跨数据复制不是那么困难,但是当您可以正确地进行自我验证并且现在无需任何额外的工作证明时,为什么还要麻烦自己呢?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM