Simplified Input Resolution in China

The company I work for trades on a project that will require our simplified Chinese input to accept our e-commerce solution. After doing a bit of research, it looks like ASP.net makes it easy to set up globalization:

<configuration> <system.web> <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="zh-Hans" uiCulture="en-us" /> </system.web> </configuration> 

Questions:

  • Is that really all ASP.net has? It seems to be true.
  • Are there any DB considerations with SQL Server 2005? Will the database accept simplified Chinese without additional configuration?
+6
source share
2 answers

Announcement 1. The real question: how far do you want to go with internationalization. Since i18n not only allows you to enter Unicode. At a minimum, you need to support local date, time and number formats, local sorting (mainly related to sorting) and ensure that your application runs correctly on localized operating systems (unless you are developing a Cloud aka solution). You might want to read more here .

As for support for entering Chinese characters, if you intend to offer software in China, you need to at least support GB18030-2000 . To do this, you need to use the correct version of the .Net Framework - one that supports Unicode 3.0. I believe this was supported with the .Net Framework 2.0.
However, if you want to take another step (which may be required to achieve a competitive advantage), you can support GB18030-2005. The only problem is that full support for these characters (CJK Unified Ideographs Extension B) came later (I'm not sure if this is Unicode 6.0 or Unicode 6.1). Therefore, you may be forced to use the latest .Net Framework and still not be sure that it covers everything.
You might want to read the Unicode FAQ for Han characters .

Announcement 2. I highly recommend that you do not use SQL Server 2005 with Chinese characters. The reason is that the old SQL Server engine only supports UCS-2, not UTF-16. This may seem like a small difference, but it really creates a problem with Han's 4-byte ideologues. In fact, you want to be able to use them in queries (i.e. LIKE or WHERE clauses) - you will get all records. Here's how it works. And in order to support them, you will need to install a very specific Chinese sort, which will simply break support for other languages.
Basically, using SQL Server 2005 with Chinese ideologists is a bad idea.

+6
source

First of all, interestingly, you are sure that you have chosen the correct culture identifier with zh-Hans , which is a neutral culture Perhaps it would be more appropriate for you to focus on a certain culture, for example, zh-CN (Chinese is used in China), if this is the market you are aiming for support.

Secondly, using the web.config file to set up a culture is great if you plan to deploy exclusively for that culture. Often you want the same deployment to dynamically adapt to the end-user culture, in which case you programmatically set Thread.CurrentCulture (and even Thread.CurrentUICulture if you provide localized resources), for example, in a URL scheme (e.g. www .myapp.com will use en-US, and www.myapp.com/china will use zh-CN) or the accept-languages ​​header or the in-app language selector.

Other than the Unicode restrictions that Paweł refers to (which means you really need to use the latest .NET Framework / SQL Server), there is nothing specific you need to do for simplified Chinese - if you follow the standard internationalization principles , you should be customized. Perhaps you should consider localizing (translating) your application into Chinese as part of this, by the way.

About SQL Server, Paweł's points seem pretty clear. However, while you are using nvarchar datatypes (Unicode) and you are not running queries in these columns or sorting them based on these columns on the DB side, I would be surprised if you had problems with SQL Server 2005. This is really depends on what you do with this data.

+2
source

Source: https://habr.com/ru/post/911529/


All Articles