home *** CD-ROM | disk | FTP | other *** search
- <%@Page Language="C#" ResponseEncoding="utf-8" %>
- <%@Import Namespace="System.Globalization"%>
- <%@ Register TagPrefix="Acme" TagName="SourceRef" Src="/quickstart/util/SrcRef.aspx"%>
-
- <!-- #include virtual="/quickstart/aspplus/include/header.inc" -->
-
- <h4>Internationalization Overview</h4>
-
-
- <div class="indent" style="font-family:Verdana; font-size:8pt;">
- <b> <img align="middle" src="/quickstart/images/bullet.gif"> </b>
- <a class="toc2" target="content" href="#encoding">Encoding Support</a><br>
- <b> <img align="middle" src="/quickstart/images/bullet.gif"> </b>
- <a class="toc2" target="content" href="#localization">Localization Support</a><br>
- <b> <img align="middle" src="/quickstart/images/bullet.gif"> </b>
- <a class="toc2" target="content" href="#config">Configuration Settings</a><br>
- </div>
-
- <p>
- <hr>
-
- <!--BEGIN SECTION-->
- <a name="encoding">
- <span class="subhead">Encoding Support</span>
- <p>
-
- ASP+ internally uses Unicode. In addition, ASP+ utilizes the String class of the
- NGWS Base Class Library and the related utility functions, which are also
- internally UNICODE. When interfacing with the outside world, ASP+ can
- be configured in several ways to use a defined encoding. This covers the encoding
- of .aspx files, of request data and response data. It is, for example, possible to
- store .aspx files with Unicode encoding and convert the HTML output of a page to an
- ANSI codepage like <nobr>iso-8859-1</nobr>.
-
- <!--BEGIN SECTION-->
- <br>
- <a name="localization">
- <br>
- <span class="subhead">Localization Support</span>
- <p>
-
- Properties of a locale are accessible through the <b>CultureInfo</b> class.
- Additionally ASP+ tracks two values of a default culture per thread and request:
- <b>CurrentCulture</b> for the default of locale dependent functions
- and <b>CurrentUICulture</b> for locale-specific lookup of resource data.
- <p>
-
- The following code snippet can be used to display the culture values on the web server
- (note, that the CultureInfo class is fully qualified):
- <div class="code"><pre>
- <%@Import Namespace="System.Globalization"%>
- ...
- <%=CultureInfo.CurrentCulture.NativeName%>
- <%=CultureInfo.CurrentUICulture.NativeName%>
- </pre></div>
-
- <p>
- The result is...
- <p>
-
- <div class="code">
- <%=System.Globalization.CultureInfo.CurrentCulture.NativeName%> <br>
- <%=System.Globalization.CultureInfo.CurrentUICulture.NativeName%>
- </div>
- <p>
-
- For locale dependent data like date/time formats or currency ASP+ leverages
- the support of the Base Class Library in the NGWS runtime. Code on ASP+ pages can
- use locale-dependent formatting routines like <b>DateTime.Format</b>. The following
- code for example will display the current date in a long format, the first
- line according to the system locale, the second one according to the
- German ("de") locale:
-
- <div class="code"><pre>
- <%=DateTime.Now.Format("f", null)%>
- <%=DateTime.Now.Format("f", new System.Globalization.CultureInfo("de"))%>
- </pre></div>
-
- <p>
- The result is...
- <p>
-
- <div class="code">
- <%=DateTime.Now.Format("f", null)%><br>
- <%=DateTime.Now.Format("f", new System.Globalization.CultureInfo("de"))%>
- </div>
-
-
- <!--BEGIN SECTION-->
-
- <a name="config">
- <br>
- <span class="subhead">Configuration Settings</span>
- <p>
-
- While creating ASP+ pages or code-behind modules, developers can use the
- base class libraries to provide features necessary for a globalized environment
- or to localize the application.
- Additionally ASP+ provides configuration settings to ease development and
- administration of ASP+ applications.
- <p>
-
- ASP+ utilizes configuration files to provide settings for a directory, which are
- usually also inherited by sub-directories. Each file can contain a
- <globalization> section, where default encodings and cultures can be
- specified. Values are valid, if they are accepted by the related classes
- Encoding and CultureInfo.
-
- <div class="code"><xmp>
- <configuration>
-
- <globalization
- fileencoding="utf-8"
- requestencoding="utf-8"
- responseencoding="utf-8"
- culture="en-us"
- uiculture="de"
- />
-
- </configuration>
- </xmp></div>
-
- The value of fileencoding determines the encoding ASP+ applies to .aspx files,
- requestencoding and responseencoding apply to request data and content sent
- as a response respectively.
- <p>
-
- The attributes of the globalization section in config.web can also be specified on
- the <%@Page ...%> directive (with the exception of fileencoding, as it applies
- to the file itself). These settings are only valid for the specific page and override
- the settings of the config file. The following sample directive defines, that the
- page uses French culture settings and uses UTF-8 encoding for the response:
-
- <div class="code"><pre>
- <%@Page Culture="fr" UICulture="fr" ResponseEncoding="utf-8"%>
- </pre></div>
- <p>
-
- Note that within a page the culture values can be changed programmatically by setting
- <b>Thread.CurrentCulture</b> and <b>Thread.UICulture</b>.
- <p>
-
- <h4>Section Summary</h4>
- <ol>
- <li>ASP+ offers support a wide range of encodings for .aspx files, request and response data.
- <li>Support for locale dependent data is given through the CultureInfo class, for which the two
- values CurrentCulture and CurrentUICulture are tracked.
- <li>Internationalization settings can be configured per machine, per directory and per page.
- </ol>
-
-
- <!-- #include virtual="/quickstart/aspplus/include/footer.inc" -->