Getting Started
  Introduction
  What is ASP.NET?
  Language Support

ASP.NET Web Forms
  Introducing Web Forms
  Working with Server Controls
  Applying Styles to Controls
  Server Control Form Validation
  Web Forms User Controls
  Data Binding Server Controls
  Server-Side Data Access
  Data Access and Customization
  Working with Business Objects
  Authoring Custom Controls
  Web Forms Controls Reference
  Web Forms Syntax Reference

XML Web services
   created using ASP.NET

  Introducing XML Web services
  Writing a Simple XML Web service
  XML Web service Type Marshalling
  Using Data in XML Web services
  Using Objects and Intrinsics
  The XML Web service Behavior
  HTML Pattern Matching

ASP.NET Web Applications
  Application Overview
  Using the Global.asax File
  Managing Application State
  HttpHandlers and Factories

Cache Services
  Caching Overview
  Page Output Caching
  Page Fragment Caching
  Page Data Caching

Configuration
  Configuration Overview
  Configuration File Format
  Retrieving Configuration

Deployment
  Deploying Applications
  Using the Process Model
  Handling Errors

Security
  Security Overview
  Authentication & Authorization
  Windows-based Authentication
  Forms-based Authentication
  Authorizing Users and Roles
  User Account Impersonation
  Security and WebServices

Localization
  Internationalization Overview
  Setting Culture and Encoding
  Localizing ASP.NET Applications
  Working with Resource Files

Tracing
  Tracing Overview
  Trace Logging to Page Output
  Application-level Trace Logging

Debugging
  The SDK Debugger

Performance
  Performance Overview
  Performance Tuning Tips
  Measuring Performance

ASP to ASP.NET Migration
  Migration Overview
  Syntax and Semantics
  Language Compatibility
  COM Interoperability
  MTS Transactions

Sample Applications
  A Personalized Portal
  An E-Commerce Storefront
  A Class Browser Application
  IBuySpy.com

  Get URL for this page

Internationalization Overview


Encoding Support

ASP.NET internally uses Unicode. In addition, ASP.NET utilizes the String class of the .NET Framework class library and the related utility functions, which are also internally Unicode. When interfacing with the outside world, ASP.NET can be configured in several ways to use a defined encoding, which includes the encoding of .aspx files, request data, and response data. For example, it is possible to store .aspx files with Unicode encoding and convert the HTML output of a page to an ANSI code page like ISO-8859-1.

Localization Support

Properties of a locale are accessible through the CultureInfo class. Additionally, ASP.NET tracks two properties of a default culture per thread and request: CurrentCulture for the default of locale-dependent functions and CurrentUICulture for locale-specific lookup of resource data.

The following code displays the culture values on the Web server. Note that the CultureInfo class is fully qualified.

The result is as follows:

English (United States)
English (United States)

For locale-dependent data like date/time formats or currency, ASP.NET leverages the support of the .NET Framework class library in the common language runtime. Code on ASP.NET pages can use locale-dependent formatting routines like DateTime.Format. For example, the following code displays the current date in a long format: the first line according to the system locale, the second one according to the German ("de") locale:

<%=DateTime.Now.ToString("f")%>
<%=DateTime.Now.ToString("f", new System.Globalization.CultureInfo("de-DE"))%>

The result is as follows:

Tuesday, March 16, 2010 4:49 PM
Dienstag, 16. März 2010 16:49

Configuration Settings

When creating ASP.NET pages or code-behind modules, developers can use the .NET Framework class library to provide features necessary for a globalized environment or to localize the application. ASP.NET also provides configuration settings to ease development and administration of ASP.NET applications.

ASP.NET utilizes configuration files to provide directory settings that are usually also inherited by subdirectories. Each file can contain a Globalization section in which you can specify default encodings and cultures. Values are valid if they are accepted by the related classes Encoding and CultureInfo. You can find more information about the Encoding and CultureInfo classes in the .NET Framework SDK.

<configuration> <system.web> <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="de-DE" /> </system.web> </configuration>
Within the Globalization section, the value of fileEncoding determines the way in which ASP.NET encodes .aspx files; the values of requestEncoding and responseEncoding determine the way in which request data and response data are encoded, respectively.

The attributes of the Globalization section in the Web.config file can also be specified on the Page directive (with the exception of fileEncoding, because it applies to the file itself). These settings are only valid for a specific page and override the settings of the Web.config file. The following sample directive specifies that the page should use French culture settings and UTF-8 encoding for the response:

<%@Page Culture="fr-FR" UICulture="fr-FR" ResponseEncoding="utf-8"%>

Note: Within a page, the culture values can be changed programmatically by setting Thread.CurrentCulture and Thread.UICulture.

Section Summary

  1. ASP.NET supports a wide range of encodings for .aspx files, request data, and response data.
  2. Support for locale-dependent data is provided by the CultureInfo class, where the two values CurrentCulture and CurrentUICulture are tracked.
  3. Internationalization settings can be configured for each computer, for each directory, and for each page.


Copyright 2001-2002 Microsoft Corporation. All rights reserved.