walkinsindia.com
 
 
 
 
 
No Registration! No Resume Posting!!
 
Receive FREE Email Alerts on Current Walk-in Interviews in India, and Apply Directly to The Employer of Your Choice! - Enter your Email ID and Subscribe Right Now!

                  

 
     
 
DotNet Localization/Globalization
Can you explain collation sequence in sql server?
Collation sequences are set of rules, which determine how the data is sorted and compared. Sorting rules can be defined with options with case-sensitivity, accent marks, kana character types, and character width.

Case sensitivity If A and a, B and b, etc. are treated in the same way then it is case-insensitive. A computer treats A and a differently because it uses ASCII code to differentiate the input. The ASCII value of A is 65, while a is 97. The ASCII value of B is 66 and b is 98.

Accent sensitivity If a and á, o and ó are treated in the same way, then it is accent-insensitive. A computer treats a and á differently because it uses ASCII code for differentiating the input. The ASCII value of a is 97 and áis 225. The ASCII value of o is 111 and ó is 243.

Kana Sensitivity When Japanese kana characters Hiragana and Katakana are treated differently, it is called Kana sensitive.

Width sensitivity When a single-byte character (half-width) and the same character when represented as a doublebyte character (full-width) are treated differently then it is width sensitive.
How do we define collation sequence for database and tables?
You can create a database with language specific collation sequence. For instance in the below create statement tblCustomer is created by Latin language collation sequence.

Create database tblCustomer collate Latin1_General_BIN

You can also create tables with particular collation sequence. Below is the create table syntax for the same.

Create table tblCustomer
(
[CustomerCode] char(10) COLLATE Albanian_CI_AI_KS_WS NULL,
[EntryDate] [char] (8) COLLATE Korean_Wansung_Unicode_CS_AS_KS NOT NULL
,
[CustAbbrev] [char] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
)
Can we change the order in a select query with a specified collation sequence?
Yes we can specify a collate sequence in the order by clause. That will change the sort according to the collation defined in the order by claused.

ORDER BY
{
order_by_expression
[ COLLATE collation_name ]
[ ASC | DESC ]
} [ ,...n ] ]
(A) Can you list best practices for globalization and localization?
Below are the best practices while developing international language support software:-

Do not hardcode strings or user interface resources.

Make sure your application depends on Unicode.

Whenever you read or write data from various encoding make, sure you use the System.Text namespace. Many programmers assume ASCII data.

While testing test it with actual international data and environments.

Whenever we manipulate data, for instance numbers, dates or currency make sure that you are using culture-aware classes defined in System. Globalization namespace. Below is the table, which specifies in more detail about the functionality and the classes to be used to achieve the same.



If a security decision is based on the result of a string comparison or case change operation, perform a culture-insensitive operation by explicitly specifying the CultureInfo.InvariantCulture property. This practice ensures that the result is not affected by the value of CultureInfo.CurrentCulture.

Move all your localizable resources to separate DLL’s.

Avoid using images and icons that contain text in your application. They are expensive to localize.

Allow plenty of room for the length of strings to expand in the user interface. In some languages, phrases can require 50-75 percent more space.

Use the System.Resources.ResourceManager class to retrieve resources based on culture.

Explicitly set the CurrentUICulture and Current Culture properties in your application. Do not rely on defaults.

Be aware that you can specify the following three types of encodings in ASP.NET:

Request Encoding specifies the encoding received from the client's browser.

Response Encoding specifies the encoding to send to the client browser. In most situations, this should be the same as request Encoding.

File Encoding specifies the default encoding for .aspx, .asmx, and .asax file parsing.
Why is the culture set to the current thread?
Thread.CurrentThread.CurrentCulture = new CultureInfo(strCulture);

It uses the current thread to set it. What does that mean? Let us drill down a bit, of how IIS handles request to understand this concept. When any user requests a resource from IIS like an ASPX page or any other resource. IIS services that request in his own thread. That means if 100 users have requested some resource from IIS he will serve every request in its own thread. In short, IIS will spawn 100 threads to service the 100 request. It is very much practically possible that you can have different locale in different threads. Therefore, when we set a culture we cannot set it for the whole application, as it will affect all the requests. So when we set a culture we set it to a particular thread rather to the whole application.
Prev



Post Interview Questions


 
     
     
 
Home  |  About Us  |  Post Walk-in for FREE  |  Policies  |  Contact Us  |  Advertise
 
 
Copyright © 2008 WalkinsIndia.com.   All Rights Reserved.