Skip to Main Content
C# in a Nutshell
book

C# in a Nutshell

by Ben Albahari, Ted Neward, Peter Drayton
March 2002
Intermediate to advanced content levelIntermediate to advanced
864 pages
31h 8m
English
O'Reilly Media, Inc.
Content preview from C# in a Nutshell

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 nonculture-specific, as well as in the default OS language. This is used with nonculture-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# 8.0 in a Nutshell

C# 8.0 in a Nutshell

Joseph Albahari, Eric Johannsen
C# 10 in a Nutshell

C# 10 in a Nutshell

Joseph Albahari
C# in a Nutshell, Second Edition

C# in a Nutshell, Second Edition

Peter Drayton, Ben Albahari, Ted Neward
Code like a Pro in C#

Code like a Pro in C#

Jort Rodenburg

Publisher Resources

ISBN: 0596001819Catalog PageErrata