Skip to Main Content
C# in a Nutshell, Second Edition
book

C# in a Nutshell, Second Edition

by Peter Drayton, Ben Albahari, Ted Neward
August 2003
Intermediate to advanced content levelIntermediate to advanced
928 pages
32h 1m
English
O'Reilly Media, Inc.
Content preview from C# in a Nutshell, Second Edition

Name

CultureInfo

Synopsis

The CultureInfo class encapsulates information about handling information according to the special requirements of a particular culture and language. Culture information is identified by language and country/region codes as specified in RFC 1766. For example, U.S. English is identified as en-US. The two-letter, lowercase language codes are defined in ISO 639-1. The two-letter, uppercase region codes are defined in ISO 3166.

The specific CultureInfo to use at runtime can be found in a number of ways. The class provides four public properties that return the current CultureInfo instance. CurrentCulture returns the value of Thread.CurrentCulture, which is the CultureInfo used by the current thread. CurrentUICulture returns the CultureInfo used by the System.Resources.ResourceManager. This can be a user, machine, or application-based locale setting. It is set in Thread.CurrentUICulture. InstalledUICulture gets the default CultureInfo used by the ResourceManager and represents the locale of the Operating system. InvariantCulture returns the CultureInfo for the invariant locale, which is non-culture-specific, as well as in the default OS language. This is used with non-culture-specific functions such as system-level calls.

The instance properties of the class provide a number of ways to retrieve the culture name. For example, NativeName gets the culture name in the language of that culture. LCID gets the NLS-specified number for a culture name. Other properties ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# in a Nutshell

C# in a Nutshell

Ben Albahari, Ted Neward, Peter Drayton
C# 7.0 in a Nutshell

C# 7.0 in a Nutshell

Joseph Albahari, Ben Albahari
C# Cookbook, 2nd Edition

C# Cookbook, 2nd Edition

Jay Hilyard, Stephen Teilhet
C# Cookbook

C# Cookbook

Stephen Teilhet, Jay Hilyard

Publisher Resources

ISBN: 0596005261Catalog PageErrata